import { fetchSearchResults } from '@/fetch/search'
import { SearchPage } from '@/pageComponents/Search/SearchPage'

export const dynamic = 'force-dynamic'

export default async function Page({
  searchParams,
}: {
  searchParams: Promise<{ q?: string }>
}) {
  const { q = '' } = await searchParams
  const results = await fetchSearchResults(q)

  return <SearchPage query={q} results={results} />
}
