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

export function useLeagueScoringPresets() {
  const { leagueService } = useServices();

  return useQuery({
    queryKey: ['leagueScoringPresets'],
    queryFn: async () => {
      const result = await leagueService.getScoringPresets();
      return result as LeagueScoringPresetDTO[];
    },
  });
}