import { Container } from '@/components/layout';
import { PageHeader } from '@/components/navigation';
import { SlotButtons, SlotDateTime, SlotOrdersList } from '@/components/schedule';
import { type SlotComponentProps } from '@/components/schedule/types';
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';

type Props = { params: Promise<SlotComponentProps> };

export default async function ProfilePage(props: Readonly<Props>) {
  const parameters = await props.params;

  const queryClient = new QueryClient();

  return (
    <HydrationBoundary state={dehydrate(queryClient)}>
      <PageHeader title={undefined} />
      <Container>
        <SlotDateTime {...parameters} />
        <SlotButtons {...parameters} />
        <SlotOrdersList {...parameters} />
      </Container>
    </HydrationBoundary>
  );
}
