import { useQuery } from "@tanstack/react-query"; import { dashboardAPI } from "../api"; import { useAuthStore } from "@/stores/authStore"; export function useDashboard() { const token = useAuthStore((s) => s.token); return useQuery({ queryKey: ["dashboard", !!token], queryFn: () => dashboardAPI.get(), staleTime: 2 * 60 * 1000, refetchInterval: 5 * 60 * 1000, }); }