'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useAuth } from '@/contexts/AuthContext'; import { useState } from 'react'; import { UsersIcon, CubeIcon, TagIcon, BellIcon, GiftIcon, PowerIcon, ShoppingBagIcon, HomeIcon, CalculatorIcon, Bars3Icon, XMarkIcon, } from '@heroicons/react/24/outline'; import { MegaphoneIcon } from 'lucide-react'; import ThemeToggle from '@/components/ThemeToggle'; const navItems = [ { href: '/admin/dashboard', label: 'داشبورد', Icon: HomeIcon }, { href: '/admin/users', label: 'کاربران', Icon: UsersIcon }, { href: '/admin/purchases', label: 'خریدها', Icon: ShoppingBagIcon }, { href: '/admin/accounting', label: 'حسابداری', Icon: CalculatorIcon }, { href: '/admin/packages', label: 'پکیجها', Icon: CubeIcon }, { href: '/admin/products', label: 'محصولات', Icon: TagIcon }, { href: '/admin/reminders', label: 'یادآوریها', Icon: BellIcon }, { href: '/admin/promotions', label: 'تبلیغات', Icon: MegaphoneIcon }, { href: '/admin/referral-rewards', label: 'پاداش معرفی', Icon: GiftIcon }, ]; export default function Sidebar() { const pathname = usePathname(); const { logout, user } = useAuth(); const [mobileOpen, setMobileOpen] = useState(false); const isActive = (href: string) => { if (href === '/admin/dashboard') return pathname === href; return pathname.startsWith(href); }; const navContent = (
اپروایجنسی
پنل مدیریت
{user.email}