2025-01-27 15:02:34 +03:00

26 lines
874 B
TypeScript

import { getProfile } from '@/actions/profile';
import { PageHeader } from '@/components/navigation';
import { ProfileCard } from '@/components/profile/profile-card';
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
type Props = { params: Promise<{ telegramId: string }> };
export default async function ProfilePage(props: Readonly<Props>) {
const parameters = await props.params;
const { telegramId } = parameters;
const queryClient = new QueryClient();
await queryClient.prefetchQuery({
queryFn: () => getProfile({ telegramId }),
queryKey: telegramId ? ['profile', 'telegramId', telegramId] : ['profile'],
});
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<PageHeader title="Профиль контакта" />
<ProfileCard telegramId={telegramId} />
</HydrationBoundary>
);
}