import { useQuery } from "@tanstack/react-query"; import { contentPresentationApi } from "../api/content-presentation.client"; import { contentPresentationQueryKeys } from "../api/content-presentation.query-keys"; export function useTemplateContractQuery(templateCode?: string | null) { const code = templateCode?.trim() ?? ""; return useQuery({ queryKey: contentPresentationQueryKeys.templateContract(code), queryFn: () => contentPresentationApi.getTemplateContract(code), enabled: Boolean(code), staleTime: 30 * 60 * 1000, gcTime: 60 * 60 * 1000, retry: 2, }); }