'use client'; import { CardSectionHeader } from '../ui'; import { CheckboxWithText, DataField } from './components'; import { type ProfileProps } from './types'; import { useCustomerMutation, useCustomerQuery } from '@/hooks/api/customers'; import { Enum_Customer_Role as Role } from '@repo/graphql/types'; import { Button } from '@repo/ui/components/ui/button'; import { Card } from '@repo/ui/components/ui/card'; import Link from 'next/link'; export function ContactDataCard({ telegramId }: Readonly) { const { data: { customer } = {} } = useCustomerQuery({ telegramId }); if (!customer) return null; return (
); } export function ProfileDataCard() { const { data: { customer } = {} } = useCustomerQuery(); const { mutate: updateCustomer } = useCustomerMutation(); if (!customer) return null; return (
updateCustomer({ data: { name } })} value={customer?.name ?? ''} /> updateCustomer({ data: { role: checked ? Role.Master : Role.Client }, }) } text="Быть мастером" />
); }