22 lines
579 B
TypeScript
22 lines
579 B
TypeScript
'use client';
|
||
|
||
import { ContactRow } from '../shared/contact-row';
|
||
import { useCustomerContacts } from '@/hooks/api/contacts';
|
||
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
|
||
|
||
export function ContactsList() {
|
||
const { contacts, isLoading } = useCustomerContacts();
|
||
|
||
if (isLoading) return <LoadingSpinner />;
|
||
|
||
if (!contacts.length) return <div>Контакты не найдены</div>;
|
||
|
||
return (
|
||
<div className="space-y-2">
|
||
{contacts.map((contact) => (
|
||
<ContactRow key={contact.documentId} {...contact} />
|
||
))}
|
||
</div>
|
||
);
|
||
}
|