'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { ShieldCheck, ListTodo, User, LayoutDashboard, Scan, BarChart3, Settings, FileText, Users, Bell } from 'lucide-react' import { cn } from '@/lib/utils' interface NavItem { icon: React.ElementType label: string href: string } // 达人端导航项 const creatorNavItems: NavItem[] = [ { icon: ListTodo, label: '我的任务', href: '/creator' }, { icon: Bell, label: '消息中心', href: '/creator/messages' }, { icon: User, label: '个人中心', href: '/creator/profile' }, ] // 代理商端导航项 const agencyNavItems: NavItem[] = [ { icon: LayoutDashboard, label: '工作台', href: '/agency' }, { icon: Scan, label: '审核决策', href: '/agency/review' }, { icon: FileText, label: 'Brief 配置', href: '/agency/briefs' }, { icon: Users, label: '达人管理', href: '/agency/creators' }, { icon: BarChart3, label: '数据报表', href: '/agency/reports' }, ] // 品牌方端导航项 const brandNavItems: NavItem[] = [ { icon: LayoutDashboard, label: '数据看板', href: '/brand' }, { icon: Settings, label: 'AI 配置', href: '/brand/ai-config' }, { icon: FileText, label: '规则配置', href: '/brand/rules' }, { icon: FileCheck, label: '终审台', href: '/brand/final-review' }, { icon: Users, label: '代理商管理', href: '/brand/agencies' }, ] interface SidebarProps { role?: 'creator' | 'agency' | 'brand' } export function Sidebar({ role = 'creator' }: SidebarProps) { const pathname = usePathname() || '' const navItems = role === 'creator' ? creatorNavItems : role === 'agency' ? agencyNavItems : brandNavItems const isActive = (href: string) => { if (href === `/${role}`) { return pathname === href || pathname === `/${role}/` } return pathname.startsWith(href) } return ( ) } export default Sidebar