import { useQuery } from "@tanstack/react-query"; import { ShieldAlert } from "lucide-react"; import { Link } from "@/lib/router"; import { accessApi } from "@/api/access"; import { queryKeys } from "@/lib/queryKeys"; import { useCompany } from "@/context/CompanyContext"; import { ToolsAccess } from "./ToolsAccess"; /** * Admin gate for the Advanced door (PAP-10862, plan D8). The developer surface * lives under `/apps/advanced` and requires `tools:admin` on the server. * This is a best-effort UX gate derived from role defaults: local boards, * instance admins, and active company owners/admins/operators pass. * The server is authoritative. */ export function AdvancedToolsRoute() { const { selectedCompanyId } = useCompany(); const boardAccess = useQuery({ queryKey: queryKeys.access.currentBoardAccess, queryFn: () => accessApi.getCurrentBoardAccess(), retry: false, }); if (boardAccess.isLoading) { return
This area lets company editors wire up tools that aren't in the gallery. Ask a company editor if you need a new app connected, or head back to{" "} your apps .