import React from 'react'
import SearchResults from './SearchResults'
import LoadingAnimation from '../Loading/LoadingAnimation'
import ErrorLoadingData from '../Errors/ErrorLoadingData'
import fetchFreeBlockSearchResults from '../../api/fetchFreeBlockSearchResults'
import GridWrapper from '../Grid/GridWrapper'
import GridItem from '../Grid/GridItem'
import { Link, useRouteMatch } from 'react-router-dom'
import styles from './SearchWrapper.module.scss'
import MainHeading from '../Titles/MainHeading'
const SearchWrapper = ({ searchParams, onSearchSubmitted }) => {
const { url } = useRouteMatch()
const { loading, data, error } = fetchFreeBlockSearchResults(searchParams)
const aggregations = !loading && !error && data && data.meta ? data.meta : {}
if (loading) return