import React from "react" ; import { TextbookGallery } from "../components" ; import Classes from "../components/classes/Classes" ; import EmailForm from "../components/forms/EmailForm" ; import { Class , Textbook } from "../typings/interfaces" ; import { shuffle , useQuery } from "../utils" ; const SearchPage = ( { classes , textbooks , loading , } ) => { let query = useQuery ( ) ; return ( < > < Classes classes = { shuffle ( classes ) ?? [ ] } displayPromo = { true } filters = { query . get ( "q" ) ?. split ( "-" ) } loading = { loading } asTable = { query . get ( "table" ) === "true" } / > { textbooks . length > 0 && ( < TextbookGallery textbooks = { shuffle ( textbooks ) ?? [ ] } filters = { query . get ( "q" ) ?. split ( "-" ) } / > ) } < EmailForm /> < />); } ; export default SearchPage ;