// components/SidebarMenu.tsx
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";

const items = [
  { href: "/", label:"Tableau de bord" },
  { href: "/contrats", label:"Contrats & Paies" },
  { href: "/salaries", label:"Salariés" },
  { href: "/cotisations", label:"Cotisations" },
  { href: "/facturation", label:"Facturation" },
];

export default function SidebarMenu() {
  const pathname = usePathname();
  return (
    <nav className="rounded-2xl border bg-white p-2">
      {items.map((it) => {
        const active = pathname === it.href;
        return (
          <Link
            key={it.href}
            href={it.href}
            className={`block px-3 py-2 rounded-xl text-sm transition ${
              active
                ? "bg-slate-100"
                : "hover:bg-slate-50"
            }`}
          >
            {it.label}
          </Link>
        );
      })}
    </nav>
  );
}