// [REQ T2]  Custom hooks – useUserReservations filtruje rezerwacje po userId zalogowanego
// [REQ D7]  React Query – useQuery z kluczem ['reservations', userId]
import { useQuery } from '@tanstack/react-query';
import { getUserReservations } from '../api/reservations';

export const useUserReservations = (userId) =>
  useQuery({
    queryKey: ['reservations', 'user', userId],
    queryFn: () => getUserReservations(userId),
    enabled: !!userId,
  });
