| 1 | import NavLink from './NavLink'; |
| 2 | import SidebarSection from './SidebarSection'; |
| 3 | import Badge from './Badge'; |
| 4 | |
| 5 | const navItems = [ |
| 6 | {href: '/', label: 'Dashboard', icon: 'home'}, |
| 7 | {href: '/products', label: 'Products', icon: 'box', count: 142}, |
| 8 | {href: '/orders', label: 'Orders', icon: 'cart', count: 38}, |
| 9 | {href: '/customers', label: 'Customers', icon: 'users'}, |
| 10 | {href: '/analytics', label: 'Analytics', icon: 'chart'}, |
| 11 | {href: '/settings', label: 'Settings', icon: 'gear'}, |
| 12 | ]; |
| 13 | |
| 14 | const recentItems = [ |
| 15 | {id: 1, label: 'Order #1234', status: 'pending'}, |
| 16 | {id: 2, label: 'Order #1235', status: 'shipped'}, |
| 17 | {id: 3, label: 'Order #1236', status: 'delivered'}, |
| 18 | {id: 4, label: 'Return #891', status: 'processing'}, |
| 19 | ]; |
| 20 | |
| 21 | export default function Sidebar({itemCount}) { |
| 22 | return ( |
| 23 | <aside className="sidebar"> |
| 24 | <nav className="sidebar-nav"> |
| 25 | <SidebarSection title="Navigation"> |
| 26 | {navItems.map(item => ( |
| 27 | <NavLink key={item.href} href={item.href} icon={item.icon}> |
| 28 | {item.label} |
| 29 | {item.count != null && <Badge count={item.count} />} |
| 30 | </NavLink> |
| 31 | ))} |
| 32 | </SidebarSection> |
| 33 | <SidebarSection title="Recent Activity"> |
| 34 | {recentItems.map(item => ( |
| 35 | <div key={item.id} className="recent-item"> |
| 36 | <span className="recent-label">{item.label}</span> |
| 37 | <Badge count={item.status} variant="status" /> |
| 38 | </div> |
| 39 | ))} |
| 40 | </SidebarSection> |
| 41 | <SidebarSection title="Quick Stats"> |
| 42 | <div className="stat"> |
| 43 | <span className="stat-label">Total Items</span> |
| 44 | <span className="stat-value">{itemCount}</span> |
| 45 | </div> |
| 46 | <div className="stat"> |
| 47 | <span className="stat-label">Active Users</span> |
| 48 | <span className="stat-value">1,247</span> |
| 49 | </div> |
| 50 | <div className="stat"> |
| 51 | <span className="stat-label">Revenue</span> |
| 52 | <span className="stat-value">$84,320</span> |
| 53 | </div> |
| 54 | </SidebarSection> |
| 55 | </nav> |
| 56 | </aside> |
| 57 | ); |
| 58 | } |