import { Link, useLocation } from "react-router"; import { LayoutDashboard, Users, User, Settings, LogOut, Menu, X, } from "lucide-react"; type SidebarProps = { isOpen: boolean; setIsOpen: React.Dispatch>; }; const Sidebar = ({ isOpen, setIsOpen, }: SidebarProps) => { const location = useLocation(); const menuClass = (path: string) => `flex items-center gap-3 px-4 py-3 rounded-xl transition-all ${ location.pathname === path ? "bg-[#008b8b] text-white" : "text-gray-700 hover:bg-gray-100" }`; return ( <> {!isOpen && ( )} {isOpen && (
setIsOpen(false)} className="fixed inset-0 bg-black/20 z-40" /> )} ); }; export default Sidebar;