import * as React from "react"
import { Container } from "../components/Container"
import { FadeIn, FadeInStagger } from "../components/FadeIn"
import { FallbackMessage } from "../components/FallbackMessage"
import { FilterModal } from "../components/FilterModal"
import { FilterScroll } from "../components/FilterScroll"
import { Loading } from "../components/Loading"
import { SearchResult } from "../components/SearchResult"
import { defaultSearchParams } from "../types/SearchParams"
import { useFetchCoaches } from "../utils/queries"
function SearchResults() {
const { isLoading, isError, data } = useFetchCoaches()
if (isLoading) {
return
}
if (isError) {
return (
)
}
return (
{data?.map((coach, index) => (
))}
)
}
export function Search() {
const [searchParams, setSearchParams] = React.useState(defaultSearchParams)
const [modalOpen, setModalOpen] = React.useState(false)
return (
setModalOpen(true)}
/>
setModalOpen(false)}
onSubmit={(q) => {
setSearchParams(q)
setModalOpen(false)
}}
/>
)
}