From f3446840e633aa6236f0c204613f61e72356da5d Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Fri, 11 Jul 2025 14:50:22 +0300 Subject: [PATCH] refactor(contact-row): replace role display logic with useIsMaster hook for improved clarity --- apps/web/components/shared/contact-row.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web/components/shared/contact-row.tsx b/apps/web/components/shared/contact-row.tsx index d2a462a..afe433b 100644 --- a/apps/web/components/shared/contact-row.tsx +++ b/apps/web/components/shared/contact-row.tsx @@ -1,4 +1,5 @@ -import * as GQL from '@repo/graphql/types'; +import { useIsMaster } from '@/hooks/api/customers'; +import type * as GQL from '@repo/graphql/types'; import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar'; import { Badge } from '@repo/ui/components/ui/badge'; import { cn } from '@repo/ui/lib/utils'; @@ -10,6 +11,8 @@ type ContactRowProps = GQL.CustomerFieldsFragment & { }; export const ContactRow = memo(function ({ className, ...contact }: ContactRowProps) { + const isMaster = useIsMaster(); + return (

{contact.name}

-

- {contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'} -

+

{isMaster ? 'Мастер' : 'Клиент'}

{contact.active ?
: Неактивен}