import { useQuery } from '@tanstack/react-query';
import { useServices } from '@/lib/services/ServiceProvider';

export function useRaceStewardingData(raceId: string, driverId: string) {
  const { raceStewardingService } = useServices();

  return useQuery({
    queryKey: ['raceStewardingData', raceId, driverId],
    queryFn: () => raceStewardingService.getRaceStewardingData(raceId, driverId),
    enabled: !!raceId && !!driverId,
  });
}