Vlad Chikalkin 10981e2afb
Issues/66 (#67)
* feat(profile): add 'Услуги' link button to LinksCard for service management

* feat(services): add create and update service functionalities with corresponding API actions and hooks
2025-08-01 19:54:10 +03:00

38 lines
930 B
TypeScript

'use client';
import { ServiceCard } from '@/components/shared/service-card';
import { useCustomerQuery } from '@/hooks/api/customers';
import { useServicesQuery } from '@/hooks/api/services';
import Link from 'next/link';
export function ServicesList() {
const { data: { customer } = {}, isLoading } = useCustomerQuery();
const { data: { services } = {} } = useServicesQuery({
filters: {
master: {
documentId: {
eq: customer?.documentId,
},
},
},
});
if (isLoading || !customer) return null;
return (
<div className="space-y-2 px-6">
{services?.map(
(service) =>
service && (
<div key={service.documentId}>
<Link href={`/profile/services/${service.documentId}`}>
<ServiceCard key={service.documentId} {...service} />
</Link>
</div>
),
)}
</div>
);
}