23 lines
634 B
TypeScript
23 lines
634 B
TypeScript
"use client";
|
|
|
|
import { useQuery } from "@tanstack/react-query";
|
|
import { useTenantId } from "@/hooks/useTenantId";
|
|
import { workspaceApi } from "@/modules/workspace/services/workspace-api";
|
|
|
|
export function useWorkspaceCapabilities() {
|
|
const { tenantId } = useTenantId();
|
|
return useQuery({
|
|
queryKey: ["workspace", tenantId, "capabilities"],
|
|
queryFn: () => workspaceApi.capabilities(tenantId!),
|
|
enabled: !!tenantId,
|
|
staleTime: 60_000,
|
|
});
|
|
}
|
|
|
|
export function useWorkspaceHealth() {
|
|
return useQuery({
|
|
queryKey: ["workspace", "health"],
|
|
queryFn: () => workspaceApi.health(),
|
|
});
|
|
}
|