import { motion } from 'framer-motion'; import { useNavigate, useLocation } from 'react-router-dom'; import { NavItem } from '@nice/client'; interface SidebarProps { navItems: Array; } export function Sidebar({ navItems }: SidebarProps) { const navigate = useNavigate(); const location = useLocation(); return (
{navItems.map((item, index) => { const isActive = location.pathname === item.path; return ( { navigate(item.path) }} className={`flex items-center gap-3 w-full p-3 rounded-lg transition-colors ${isActive ? 'bg-blue-50 text-blue-600' : 'text-gray-700 hover:bg-blue-50 hover:text-blue-600' }`} > {item.icon} {item.label} ); })}
); }