- Updated the `addContact` function to allow all users to add contacts, removing the previous restriction that only masters could do so. - Deleted the `become-master` feature and related utility functions, streamlining the codebase. - Adjusted command settings to reflect the removal of the master role functionality. - Refactored components and hooks to eliminate dependencies on the master role, enhancing user experience and simplifying logic.
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { getSlot } from '@/actions/api/slots';
|
|
import { Container } from '@/components/layout';
|
|
import { PageHeader } from '@/components/navigation';
|
|
import { SlotButtons, SlotDateTime, SlotOrdersList } from '@/components/schedule';
|
|
import { type SlotPageParameters } from '@/components/schedule/types';
|
|
import { BookButton } from '@/components/shared/book-button';
|
|
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
|
|
|
|
type Props = { params: Promise<SlotPageParameters> };
|
|
|
|
export default async function SlotPage(props: Readonly<Props>) {
|
|
const parameters = await props.params;
|
|
const documentId = parameters.documentId;
|
|
|
|
const queryClient = new QueryClient();
|
|
|
|
await queryClient.prefetchQuery({
|
|
queryFn: () => getSlot({ documentId }),
|
|
queryKey: ['slot', documentId],
|
|
});
|
|
|
|
return (
|
|
<HydrationBoundary state={dehydrate(queryClient)}>
|
|
<PageHeader title="Слот" />
|
|
<Container>
|
|
<SlotDateTime {...parameters} />
|
|
<SlotOrdersList {...parameters} />
|
|
<BookButton label="Создать запись" />
|
|
<div className="pb-24" />
|
|
<SlotButtons {...parameters} />
|
|
</Container>
|
|
</HydrationBoundary>
|
|
);
|
|
}
|