SearchResultList.tsx 775 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React, { FC } from 'react';
  2. import SearchResultListItem from './SearchResultListItem';
  3. import { IPage } from '../../interfaces/page';
  4. export type ISearchedPage = IPage & {
  5. _id: string,
  6. snippet: string,
  7. noLink: boolean,
  8. lastUpdateUser: any,
  9. elasticSearchResult: {
  10. snippet: string,
  11. },
  12. };
  13. type Props = {
  14. pages: ISearchedPage[],
  15. deletionMode: boolean,
  16. selectedPages: ISearchedPage[],
  17. onClickInvoked?: (pageId: string) => void,
  18. }
  19. const SearchResultList: FC<Props> = (props:Props) => {
  20. return (
  21. <>
  22. {props.pages.map((page) => {
  23. return (
  24. <SearchResultListItem
  25. page={page}
  26. onClickInvoked={props.onClickInvoked}
  27. />
  28. );
  29. })}
  30. </>
  31. );
  32. };
  33. export default SearchResultList;