2import Link from "next/link";
3import { usePathname } from "next/navigation";
5interface SidebarProps {
10 { name: "Home", path: "/pages/home", icon: "🏠" },
11 { name: "Sales", path: "/pages/sales", icon: "💰" },
12 { name: "Products", path: "/pages/products", icon: "📦" },
13 { name: "Customers", path: "/pages/customers", icon: "👥" },
14 { name: "Reports", path: "/pages/reports", icon: "📊" },
15 { name: "Stores", path: "/pages/stores", icon: "🏪" },
18export default function Sidebar({ currentPage }: SidebarProps) {
19 const pathname = usePathname();
22 <div className="bg-white shadow-lg w-64 min-h-screen flex flex-col">
24 <div className="p-6 border-b">
25 <h1 className="text-xl font-bold text-gray-800">EverydayPOS</h1>
26 <p className="text-sm text-gray-600">Point of Sale System</p>
30 <nav className="flex-1 p-4">
31 <ul className="space-y-2">
32 {menuItems.map((item) => {
33 const isActive = currentPage === item.name.toLowerCase() || pathname === item.path;
38 className={`flex items-center p-3 rounded-lg transition-colors ${
40 ? "bg-blue-100 text-blue-700 border-r-4 border-blue-700"
41 : "text-gray-700 hover:bg-gray-100"
44 <span className="mr-3 text-lg">{item.icon}</span>
45 <span className="font-medium">{item.name}</span>
54 <div className="p-4 border-t">
57 className="flex items-center p-2 text-gray-600 hover:text-gray-800 transition-colors"
59 <span className="mr-2">🚪</span>