'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' interface AdminSidebarProps { userName?: string } export default function AdminSidebar({ userName }: AdminSidebarProps) { const pathname = usePathname() const isActive = (href: string) => { // Exact match for dashboard if (href === '/admin') { return pathname === '/admin' || pathname === '/admin/analytics' } // For other routes, check if pathname starts with href return pathname.startsWith(href) } const menuItems = [ { href: '/admin', label: '📊 Dashboard', icon: '📊' }, { href: '/admin/users', label: '👥 Users', icon: '👥' }, { href: '/admin/webinars', label: '📹 Webinars', icon: '📹' }, { href: '/admin/registrations', label: '📝 Registrations', icon: '📝' }, { href: '/admin/contact-messages', label: '📧 Messages', icon: '📧' }, { href: '/admin/setup', label: '⚙️ Setup', icon: '⚙️' }, ] return ( ) }