import { useQuery } from "@tanstack/react-query";
import { apiRequest } from "@/lib/queryClient";
export function useLicense() {
    const { data, isLoading } = useQuery({
        queryKey: ["/api/license/status"],
        queryFn: async () => {
            const res = await apiRequest("GET", "/api/license/status");
            return res.json();
        },
        staleTime: 1000 * 60 * 5, // cache for 5 minutes
    });
    const isLicensed = !isLoading && !!data?.activated && !data?.expired;
    return { isLicensed, isLoading, licenseData: data };
}
