'use client'; import { usePathname, useRouter } from 'next/navigation'; import { Inbox, Package, FolderKanban, Tag, Users, LayoutGrid, Search, Lightbulb, Clock, Shield } from 'lucide-react'; const NAV_GROUPS = [ { label: '工作区', items: [ { label: '与我相关', path: '/workspace', icon: Inbox }, { label: '产品', path: '/products', icon: Package }, { label: '项目', path: '/projects', icon: FolderKanban }, { label: '版本', path: '/versions', icon: Tag }, { label: '需求池', path: '/requirements', icon: Lightbulb }, { label: '加班记录', path: '/overtime', icon: Clock }, ], }, { label: '管理', items: [ { label: '成员', path: '/admin/members', icon: Users }, { label: '角色', path: '/admin/roles', icon: Shield }, ], }, ]; export function Sidebar() { const pathname = usePathname(); const router = useRouter(); const isActive = (path: string) => pathname === path || (path !== '/' && pathname.startsWith(path)); return ( ); }