TorbatYar/frontend/modules/workspace/hooks/useWorkspaceEntitlement.ts
Mortezakoohjani a483b47369 feat(workspace): complete production workspace and content operations
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 11:54:17 +03:30

16 lines
490 B
TypeScript

"use client";
import { useQuery } from "@tanstack/react-query";
import { checkFeatureAccess } from "@/modules/commercial/adapters";
import { useTenantId } from "@/hooks/useTenantId";
export function useWorkspaceEntitlement() {
const { tenantId } = useTenantId();
return useQuery({
queryKey: ["workspace", tenantId, "entitlement"],
queryFn: () => checkFeatureAccess(tenantId!, "workspace.module.enabled"),
enabled: !!tenantId,
staleTime: 60_000,
});
}