"use client" import { cn } from "@lib/utils" import { Blocks, CalendarClock, Cpu, ScrollText } from "lucide-react" import Link from "next/link" import { usePathname } from "next/navigation" import CompanyBrainConnections from "@/components/settings/company-brain-connections" import CompanyBrainModels from "@/components/settings/company-brain-models" import CompanyBrainProactivity from "@/components/settings/company-brain-proactivity" import Proactiveness from "@/components/settings/proactiveness" import { ProactivenessIcon } from "@/components/settings/proactiveness-icon" import { WorkspacePrompt } from "@/components/settings/workspace-prompt" import { ErrorBoundary } from "@/components/error-boundary" import { useAuth } from "@lib/auth-context" import { type ConfigureSection, configureSectionToPath, DEFAULT_CONFIGURE_SECTION, pathToConfigureSection, } from "@/lib/configure-routes" import { dmSans125ClassName } from "@/lib/fonts" const SECTIONS: { id: ConfigureSection label: string description: string icon: React.ComponentType<{ className?: string }> }[] = [ { id: "tools", label: "Integrations", description: "Connect the tools your brain works with. Your account covers your own actions and reads; workspace accounts are a shared fallback.", icon: Blocks, }, { id: "models", label: "Models", description: "Pick how fast or thorough your brain should be. Fine-tune each task under Advanced.", icon: Cpu, }, { id: "workspace-prompt", label: "Workspace Prompt", description: "Persistent guidance for how your brain works across the workspace. Fixed safety, access, and approval constraints still apply.", icon: ScrollText, }, { id: "proactivity", label: "Proactivity", description: "When Company Brain speaks up in Slack without being asked. Quiet channels are still read and remembered.", icon: ProactivenessIcon, }, { id: "automations", label: "Automations", description: "Read-only scheduled summaries posted to Slack channels or DMs. You manage the ones you create.", icon: CalendarClock, }, ] export function ConfigureView() { const { org } = useAuth() const pathname = usePathname() // Reachable via ?view=configure too, where the path carries no section. const activeSection = pathToConfigureSection(pathname) ?? DEFAULT_CONFIGURE_SECTION const active = SECTIONS.find((section) => section.id === activeSection) if (!active) return null return (
{active.description}