SearchResultList.jsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import SearchResultListItem from './SearchResultListItem';
  4. import PaginationWrapper from '../PaginationWrapper';
  5. class SearchResultList extends React.Component {
  6. render() {
  7. return (
  8. <>
  9. {this.props.pages.map((page) => {
  10. // TODO : send cetain length of body (revisionBody) from elastisearch by adding some settings to the query and
  11. // when keyword is not in page content, display revisionBody.
  12. // TASK : https://estoc.weseek.co.jp/redmine/issues/79606
  13. return (
  14. <SearchResultListItem
  15. page={page}
  16. onClickInvoked={this.props.onClickInvoked}
  17. noLink
  18. />
  19. );
  20. })}
  21. {this.props.searchResultCount != null && this.props.searchResultCount > 0 && (
  22. <div className="my-4 mx-auto">
  23. <PaginationWrapper
  24. activePage={this.props.activePage}
  25. changePage={this.props.onPagingNumberChanged}
  26. totalItemsCount={this.props.searchResultCount || 0}
  27. pagingLimit={this.props.pagingLimit}
  28. />
  29. </div>
  30. )}
  31. </>
  32. );
  33. }
  34. }
  35. SearchResultList.propTypes = {
  36. pages: PropTypes.array.isRequired,
  37. deletionMode: PropTypes.bool.isRequired,
  38. selectedPages: PropTypes.array.isRequired,
  39. searchResultCount: PropTypes.number,
  40. activePage: PropTypes.number.isRequired,
  41. pagingLimit: PropTypes.number,
  42. onClickInvoked: PropTypes.func,
  43. onChangeInvoked: PropTypes.func,
  44. onPagingNumberChanged: PropTypes.func,
  45. };
  46. export default SearchResultList;