SearchPageLayout.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import React, { FC } from 'react';
  2. import PropTypes from 'prop-types';
  3. type SearchResultMeta = {
  4. took : number,
  5. total : number,
  6. results: number
  7. }
  8. type Props = {
  9. SearchControl:JSX.Element,
  10. SearchResultList: JSX.Element,
  11. SearchResultContent: JSX.Element,
  12. searchResultMeta: SearchResultMeta,
  13. searchingKeyword: string
  14. }
  15. const SearchPageLayout: FC<Props> = (props: Props) => {
  16. return (
  17. <div className="content-main">
  18. <div className="search-result row" id="search-result">
  19. <div className="col-lg-6 d-none d-lg-block page-list search-result-list pr-0" id="search-result-list">
  20. <nav>{props.SearchControl}</nav>
  21. <div className="d-flex align-items-start justify-content-between mt-1">
  22. <div className="search-result-meta">
  23. <i className="icon-magnifier" /> Found {props.searchResultMeta.total} pages with &quot;{props.searchingKeyword}&quot;
  24. </div>
  25. </div>
  26. <div className="page-list">
  27. <ul className="page-list-ul page-list-ul-flat nav nav-pills">{props.SearchResultList}</ul>
  28. </div>
  29. </div>
  30. <div className="col-lg-6 search-result-content">
  31. {props.SearchResultContent}
  32. </div>
  33. </div>
  34. </div>
  35. );
  36. };
  37. SearchPageLayout.propTypes = {
  38. SearchControl: PropTypes.element.isRequired,
  39. SearchResultList: PropTypes.element.isRequired,
  40. SearchResultContent: PropTypes.element.isRequired,
  41. // searchResultMeta: PropTypes.object.isRequired, // TODO fix lint error
  42. searchingKeyword: PropTypes.string.isRequired,
  43. };
  44. export default SearchPageLayout;