import type { LucideIcon } from "lucide-react"; import { Brain, Database, FolderKanban, KeyRound, MessageSquare, Sparkles, } from "lucide-react"; import type { MessageKey } from "@/i18n/i18n-context"; export interface NavItem { titleKey: MessageKey; href: string; badge?: string; } export interface SidebarNavItem { titleKey: MessageKey; href: string | null; icon: LucideIcon; comingSoon?: boolean; tooltipKey?: MessageKey; } export interface SidebarGroup { titleKey: MessageKey; items: SidebarNavItem[]; } /** * Sidebar groups in webUI order. Only routes that the dashboard actually * implements appear here — `/projects` lands under ACCOUNT alongside the * model configuration entry, mirroring webUI's "ACCOUNT" section. * * Titles are stored as i18n keys (see `src/i18n/locales/*`) and resolved via * `t()` in the rendering components so navigation is language-aware. */ export const sidebarGroups: SidebarGroup[] = [ { titleKey: "nav.groupChat", items: [{ titleKey: "nav.chatAgent", href: "/chat", icon: MessageSquare }], }, { titleKey: "nav.groupMemory", items: [{ titleKey: "nav.memoryManage", href: "/memory", icon: Brain }], }, { titleKey: "nav.groupKnowledgeBase", items: [ { titleKey: "nav.knowledgeBaseManage", href: "/knowledge-base", icon: Database, }, ], }, { titleKey: "nav.groupConfig", items: [ { titleKey: "nav.llmProviders", href: "/llm-providers", icon: Sparkles }, { titleKey: "nav.apiKeys", href: "/api-keys", icon: KeyRound }, { titleKey: "nav.projects", href: "/projects", icon: FolderKanban }, ], }, ]; /** * Flat list derived from the grouped structure. Kept exported because the * mobile sidebar and a handful of legacy callers iterate the flat sequence. */ export const sidebarNav: SidebarNavItem[] = sidebarGroups.flatMap( (group) => group.items, ); /** @deprecated retained for backwards compatibility — moved into `sidebarGroups`. */ export const sidebarResources: SidebarNavItem[] = []; /** * @deprecated Kept for backwards compatibility; prefer `sidebarGroups`. */ export const mainNav: NavItem[] = [ { titleKey: "nav.groupMemory", href: "/memory" }, { titleKey: "nav.groupKnowledgeBase", href: "/knowledge-base" }, ];