16 lines
490 B
TypeScript
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,
|
|
});
|
|
}
|