import {
  SignatureListResponse,
  TeeterListResponse,
} from "@/record-management/dto/userRecords/teetersAndSignatureDto";
import {
  fetchSignatureList,
  fetchTeetersList,
} from "@/record-management/services/api/signatureAndTeeterService";
import { useQuery, UseQueryOptions } from "@tanstack/react-query";

/* ─────────────────  Signature  ───────────────── */

export const useSignatureList = <TData = SignatureListResponse>(id: string) =>
  useQuery({
    queryKey: ["signatureList"],
    queryFn: () => fetchSignatureList(id),
    enabled: !!id,
    staleTime: 5 * 60 * 1000,
  });

/* ─────────────────  Teeters (Amharic / English)  ───────────────── */

export const useTeetersList = <TData = TeeterListResponse>(id: string) =>
  useQuery({
    queryKey: ["teetersList"],
    queryFn: () => fetchTeetersList(id),
    enabled: !!id,
    staleTime: 5 * 60 * 1000,
  });
