import React from 'react' import Pagination from '../Search/Pagination' import GridWrapper from '../Grid/GridWrapper' import GridItem from '../Grid/GridItem' import SearchResultItem from './SearchResultItem' import MainHeading from '../Titles/MainHeading' import NoResultsFound from '../Search/NoResultsFound' const SearchResults = ({ searchResults, searchParams, onSearchSubmitted }) => { const numberOfResults = searchResults.results.search_query_result.search_payload.total_hits if (numberOfResults === 0) { return } // Just checking if we have a search string to show the appropriate sub title string // if there is no search 1 will be the length as it returns page numbers as a key const isSearching = Object.keys(searchParams).length > 1 const subTitleString = isSearching ? `Search results: ${numberOfResults}` : `Browse our collection of ${numberOfResults}` return ( <> 1 ? 's' : ''}`} /> { searchResults.results.search_query_result.search_payload.items.map(item => ( )) } ) } export default SearchResults