import { NavLink, useNavigate } from 'react-router-dom'; import { Dropdown, Avatar, Tooltip } from 'antd'; import { SearchOutlined, MessageOutlined, RobotOutlined, CompassOutlined, BookOutlined, ApartmentOutlined, BarChartOutlined, TeamOutlined, LogoutOutlined, LeftOutlined, RightOutlined, UserOutlined, CreditCardOutlined, ShoppingCartOutlined, DatabaseOutlined } from '@ant-design/icons'; import { useAuth } from '../store/auth'; import kaiwuIcon from '../assets/brand/kaiwu-icon-gradient-transparent.png'; import './Sidebar.css'; interface Props { onOpenPalette?: () => void; onNavigate?: () => void; collapsed?: boolean; onToggleCollapse?: () => void; } const NAV_GROUPS: Array<{ label: string; items: Array<{ to: string; icon: React.ReactNode; label: string; end?: boolean }>; }> = [ { label: '工作台', items: [ { to: '/chat', icon: , label: '聊天' }, { to: '/agents', icon: , label: '我的智能体' }, // { to: '/marketplace', icon: , label: '智能体广场' } ] }, { label: '资源', items: [ { to: '/knowledge', icon: , label: '知识库' }, { to: '/prompts', icon: , label: 'Prompt 模板库' }, { to: '/workflows', icon: , label: '工作流' } ] }, { label: '管理', items: [ { to: '/stats', icon: , label: '调用统计' }, { to: '/teams', icon: , label: '团队' } ] }, { label: '商城', items: [ { to: '/points-mall', icon: , label: 'Token 商城' }, { to: '/pricing', icon: , label: '会员计划' } ] } ]; export default function Sidebar({ onOpenPalette, onNavigate, collapsed, onToggleCollapse }: Props) { const { user, logout } = useAuth(); const navigate = useNavigate(); const isMac = typeof navigator !== 'undefined' && /mac|iphone|ipad|ipod/i.test(navigator.platform || ''); const cmdKey = isMac ? '⌘' : 'Ctrl'; return ( ); }