import api from "@/lib/api"; import { useQuery } from "@tanstack/react-query"; type AuthResponse = { enabled: boolean; authenticated: boolean; }; export const useAuth = () => { const { data, isLoading } = useQuery({ queryKey: ["auth"], queryFn: () => api.get("/auth/status"), retry: false, }); return { isLoading, isEnabled: data?.enabled, isAuthenticated: data?.authenticated, }; };