import { useQuery } from "@tanstack/react-query";
import { apiFetch } from "./client";
import type { ProviderStatus } from "@/types/api";

export function useProviderStatuses() {
  return useQuery({
    queryKey: ["providers", "status"],
    queryFn: () => apiFetch<ProviderStatus[]>("/v1/admin/providers/status"),
    refetchInterval: 15_000,
  });
}
