Self-hosted US Congress monitoring platform with AI policy briefs, bill/member/topic follows, ntfy + RSS + email notifications, alignment scoring, collections, and draft-letter generator. Authored by: Jack Levy
14 lines
391 B
TypeScript
14 lines
391 B
TypeScript
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,
|
|
});
|
|
}
|