import React from 'react'; import {ProfilePreviewType, CategoryPreviewType} from '../../types'; import SearchResultsCell from './SearchResultCell'; import {useSelector} from 'react-redux'; import {RootState} from '../../store/rootReducer'; interface SearchResultsProps { results: ProfilePreviewType[]; categories: CategoryPreviewType[]; } const SearchResults: React.FC = ({results, categories}) => { /** * Added the following swicth case to make Results on Search and Recents screen a list * Flex is love */ const {user: loggedInUser} = useSelector((state: RootState) => state.user); return ( <> {categories .slice(0) .reverse() .map((category: CategoryPreviewType) => ( ))} {results .slice(0) .reverse() .map((profile: ProfilePreviewType) => ( ))} ); }; export default SearchResults;