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

export function usePiiAnalyze() {
  return useMutation({
    mutationFn: (text: string) =>
      apiFetch<PiiAnalyzeResult>("/v1/pii/analyze", {
        method: "POST",
        body: JSON.stringify({ text }),
      }),
  });
}
