'use client'; import { DaySlotAddForm } from './day-slot-add-form'; import { SlotCard } from './slot-card'; import { useCustomerQuery } from '@/hooks/api/customers'; import { useMasterSlotsQuery } from '@/hooks/api/slots'; import { useDateTimeStore } from '@/stores/datetime'; import { LoadingSpinner } from '@repo/ui/components/ui/spinner'; import { formatDate } from '@repo/utils/datetime-format'; export function DaySlotsList() { const { data: { customer } = {} } = useCustomerQuery(); const selectedDate = useDateTimeStore((store) => store.date); const { data: { slots } = {}, isLoading } = useMasterSlotsQuery({ filters: { date: { eq: formatDate(selectedDate).db() }, master: { documentId: { eq: customer?.documentId } }, }, }); if (isLoading) return ; return (

Слоты

{slots?.map((slot) => slot && )}
); }