import { Link, useLocation } from 'react-router-dom'; import { Package, ChevronRight, Puzzle, Wrench, Server, Settings } from 'lucide-react'; import { usePlugins } from '@hooks/usePlugins'; import { cn } from '@lib/utils'; /** * 平台导航项配置 * 一等入口:插件、Tool、MCP、System */ const platformNavItems = [ { path: '/plugins', label: '插件中心', icon: Puzzle, matchPattern: /^\/plugins/, }, { path: '/tools', label: 'Tool 目录', icon: Wrench, matchPattern: /^\/tools/, }, { path: '/mcp', label: 'MCP 服务', icon: Server, matchPattern: /^\/mcp/, }, { path: '/system', label: '系统状态', icon: Settings, matchPattern: /^\/system/, }, ]; /** * 控制台侧边栏 * 分为平台导航和插件运行区 */ export function Sidebar() { const location = useLocation(); const { data: plugins, isLoading } = usePlugins(); // 只显示 enabled 状态的插件 const enabledPlugins = plugins?.filter((p) => p.status === 'enabled') || []; return ( ); }