import { GitBranch, Server, Key, Cpu, Wrench, Download, ChevronLeft, ChevronRight, Rocket, Zap, History, CloudSync, Puzzle, Settings, BookOpen, Users, Sun, Moon, LogOut, } from 'lucide-react'; import { useTheme } from '@/providers/theme'; type ModuleType = 'pipelines' | 'gitops' | 'batch-release' | 'release-records' | 'environments' | 'credentials' | 'build-nodes' | 'tools' | 'jenkins-import' | 'plugins' | 'users' | 'docs' | 'settings'; interface SidebarProps { activeModule: ModuleType; onModuleChange: (module: ModuleType) => void; collapsed: boolean; onToggleCollapse: () => void; onLogout?: () => void; } const menuGroups: { label: string; items: { id: ModuleType; label: string; icon: typeof GitBranch }[] }[] = [ { label: '发布', items: [ { id: 'pipelines', label: '流水线', icon: GitBranch }, { id: 'gitops', label: 'GitOps 部署', icon: CloudSync }, { id: 'batch-release', label: '批量发布', icon: Zap }, { id: 'release-records', label: '发布记录', icon: History }, ], }, { label: '资源', items: [ { id: 'environments', label: '环境管理', icon: Server }, { id: 'credentials', label: '凭证管理', icon: Key }, { id: 'build-nodes', label: '构建节点', icon: Cpu }, ], }, { label: '集成', items: [ { id: 'jenkins-import', label: 'Jenkins导入', icon: Download }, { id: 'tools', label: '工具配置', icon: Wrench }, ], }, { label: '系统', items: [ { id: 'docs', label: '文档', icon: BookOpen }, { id: 'plugins', label: '插件市场', icon: Puzzle }, { id: 'users', label: '用户管理', icon: Users }, { id: 'settings', label: '系统设置', icon: Settings }, ], }, ]; export default function Sidebar({ activeModule, onModuleChange, collapsed, onToggleCollapse, onLogout }: SidebarProps) { const { toggle: themeToggle, isDark } = useTheme(); return (