diff --git a/apps/web/app/(main)/profile/page.tsx b/apps/web/app/(main)/profile/page.tsx index a03039b..b198f1a 100644 --- a/apps/web/app/(main)/profile/page.tsx +++ b/apps/web/app/(main)/profile/page.tsx @@ -2,22 +2,25 @@ import { getCustomer } from '@/actions/api/customers'; import { getSessionUser } from '@/actions/session'; import { Container } from '@/components/layout'; import { LinksCard, PersonCard, ProfileDataCard, SubscriptionInfoBar } from '@/components/profile'; +import { isCustomerMaster } from '@repo/utils/customer'; import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; export default async function ProfilePage() { const queryClient = new QueryClient(); const { telegramId } = await getSessionUser(); - await queryClient.prefetchQuery({ + const { customer } = await queryClient.fetchQuery({ queryFn: () => getCustomer({ telegramId }), queryKey: ['customer', telegramId], }); + const isMaster = customer && isCustomerMaster(customer); + return ( - + {isMaster ? : null}