import { getPluginInsights } from "../api"; import { queryOptions } from "@tanstack/react-query"; export const getPluginInsightsQueryOptions = (slug: string) => { return queryOptions({ queryKey: ['plugin-insights', slug], queryFn: () => getPluginInsights(slug), enabled: !!slug, staleTime: 1000 * 60 * 60 * 24, // 24 hours gcTime: 1000 * 60 * 60 * 24, // 24 hours refetchOnWindowFocus: false, refetchOnMount: false, }); }