// [REQ T2]  Custom hooks – useSlotReservations pobiera rezerwacje dla danego slotu (serwis+data)
// [REQ D7]  React Query – useQuery z kluczem ['slot-reservations', serviceId, date]
import { useQuery } from '@tanstack/react-query';
import { getReservationsBySlot } from '../api/reservations';

export const useSlotReservations = (serviceId, date) =>
  useQuery({
    queryKey: ['reservations', 'slot', serviceId, date],
    queryFn: () => getReservationsBySlot(serviceId, date),
    enabled: !!serviceId && !!date,
  });
