'use client'; import { DataNotFound } from '@/components/shared/alert'; import { useServicesQuery } from '@/hooks/api/services'; import { useOrderStore } from '@/stores/order'; import { type ServiceFieldsFragment } from '@repo/graphql/types'; import { cn } from '@repo/ui/lib/utils'; import { formatTime } from '@repo/utils/datetime-format'; export function ServiceSelect() { const { data: { services } = {} } = useServicesQuery({}); if (!services?.length) return ; return (
{services.map((service) => service && )}
); } function ServiceCard({ documentId, duration, name }: Readonly) { const serviceId = useOrderStore((store) => store.serviceId); const setServiceId = useOrderStore((store) => store.setServiceId); const selected = serviceId === documentId; function handleOnSelect() { setServiceId(documentId); } return ( ); }