import React, { useState } from 'react'; import { NavLink, useNavigate } from 'react-router-dom'; import { LayoutDashboard, Package, Users, ShoppingCart, Settings, Ticket, LogOut, Search, Bell, User, Menu, X, Home } from 'lucide-react'; import Logo from './Logo'; import { useAuthStore } from '../store/useAuthStore'; interface AdminLayoutProps { children: React.ReactNode; } const AdminLayout: React.FC = ({ children }) => { const navigate = useNavigate(); const logout = useAuthStore((state) => state.logout); const user = useAuthStore((state) => state.user); const [isSidebarOpen, setIsSidebarOpen] = useState(false); const menuItems = [ { id: 'dashboard', label: 'لوحة التحكم', icon: LayoutDashboard, path: '/admin' }, { id: 'products', label: 'المنتجات', icon: Package, path: '/admin/products' }, { id: 'users', label: 'المستخدمين', icon: Users, path: '/admin/users' }, { id: 'orders', label: 'الطلبات', icon: ShoppingCart, path: '/admin/orders' }, { id: 'coupons', label: 'الكوبونات', icon: Ticket, path: '/admin/coupons' }, { id: 'settings', label: 'الإعدادات', icon: Settings, path: '/admin/settings' }, ]; const handleLogout = () => { logout(); navigate('/login'); }; return (
{/* Mobile Overlay */}
setIsSidebarOpen(false)} aria-hidden="true" /> {/* Sidebar */} {/* Main Content */}
{/* Header */}

{user?.name || 'الأدمن'}

{user?.role || 'ADMIN'}

{user?.name?.[0] || }
{children}
); }; export default AdminLayout;