23 lines
641 B
TypeScript
23 lines
641 B
TypeScript
'use client';
|
|
|
|
import { DataNotFound } from '../shared/alert';
|
|
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 <DataNotFound title="Контакты не найдены" />;
|
|
|
|
return (
|
|
<div className="space-y-2">
|
|
{contacts.map((contact) => (
|
|
<ContactRow key={contact.documentId} {...contact} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|