import { useQuery } from '@tanstack/react-query';
import { metricsService } from '../services/metrics';

export function useMetricsByPortal(cpf: string, ano: number) {
  return useQuery({
    queryKey: ['metricsByPortal', cpf, ano],
    queryFn: () => metricsService.getMetricsByPortal({ cpf, ano }),
    enabled: !!cpf && !!ano,
  });
}

export function useMetricsBySystems(cpf: string, ano: number) {
  return useQuery({
    queryKey: ['metricsBySystems', cpf, ano],
    queryFn: () => metricsService.getMetricsBySystems({ cpf, ano }),
    enabled: !!cpf && !!ano,
  });
}
