import { useQuery } from "@tanstack/react-query";
import { getTermsAndPolicies } from "../api/terms.api";

export const useTermsAndPolicies = (type) =>
  useQuery({
    queryKey: ["terms-and-policies", type],
    queryFn: () => getTermsAndPolicies(type),
    enabled: Boolean(type),
    staleTime: 1000 * 60 * 60,
    refetchOnWindowFocus: false,
  });
