import { useQuery } from '@tanstack/react-query';
import { useInject } from '@/lib/di/hooks/useInject';
import { PENALTY_SERVICE_TOKEN } from '@/lib/di/tokens';
import { enhanceQueryResult } from '@/lib/di/hooks/useReactQueryWithApiError';

export function usePenaltyTypesReference() {
  const penaltyService = useInject(PENALTY_SERVICE_TOKEN);

  const queryResult = useQuery({
    queryKey: ['penaltyTypesReference'],
    queryFn: () => penaltyService.getPenaltyTypesReference(),
  });

  return enhanceQueryResult(queryResult);
}
