import type { SearchParams } from 'nuqs/server';
import { OverviewFilterPanel } from '@/features/overview/components/overview-filter-panel';
import { getOverviewDashboardData } from '@/features/overview/server/overview-data';
import { searchParamsCache } from '@/lib/searchparams';

type PageProps = {
  searchParams: Promise<SearchParams>;
};

export default async function OverviewPage(props: PageProps) {
  const searchParams = await props.searchParams;
  searchParamsCache.parse(searchParams);
  const data = await getOverviewDashboardData();

  return <OverviewFilterPanel data={data} />;
}
