2025-06-24 11:38:01 +03:00

30 lines
874 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client';
import { type OrderComponentProps } from './types';
import { useOrderQuery } from '@/hooks/api/orders';
import { type ServiceFieldsFragment } from '@repo/graphql/types';
type ServiceCardProps = Pick<ServiceFieldsFragment, 'name'>;
export function OrderServices({ documentId }: Readonly<OrderComponentProps>) {
const { data: { order } = {} } = useOrderQuery({ documentId });
if (!order) return null;
return (
<div className="flex flex-col space-y-2">
<h1 className="font-bold">Услуги</h1>
{order.services?.map(
(service) => service && <ServiceCard key={service.documentId} {...service} />,
)}
</div>
);
}
function ServiceCard({ name }: Readonly<ServiceCardProps>) {
return (
<div className="flex items-center justify-between rounded-2xl border-2 bg-background p-4 px-6">
{name}
</div>
);
}