'use client'; import { LoadingSpinner } from '../common/spinner'; import { useCustomerContacts } from '@/hooks/contacts'; import * as GQL from '@repo/graphql/types'; import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar'; import Link from 'next/link'; import { memo } from 'react'; type ContactRowProps = { readonly contact: GQL.CustomerFieldsFragment; }; const ContactRow = memo(function ({ contact }: ContactRowProps) { return (
{contact.name.charAt(0)}

{contact.name}

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

); }); export function ContactsList() { const { contacts, isLoading } = useCustomerContacts(); if (isLoading) return ; if (!contacts.length) return
Контакты не найдены
; return (
{contacts.map((contact) => ( ))}
); }