"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";

const navItems = [
  { href: "/admin/mainpage-settings", label: "메인페이지 설정" },
  { href: "/admin/boards", label: "게시판" },
  { href: "/admin/banners", label: "배너" },
  { href: "/admin/partners", label: "제휴업체" },
  { href: "/admin/users", label: "사용자" },
  { href: "/admin/logs", label: "로그" },
];

export default function AdminSidebar() {
  const pathname = usePathname();
  return (
    <aside className="w-56 shrink-0 border-r border-neutral-200 bg-white/80 backdrop-blur h-full">
      <div className="px-4 py-4 border-b border-neutral-200">
        <Link href="/admin" className="block text-lg font-bold text-neutral-900">관리자</Link>
      </div>
      <nav className="p-2 space-y-1">
        {navItems.map((it) => {
          const active = pathname === it.href;
          return (
            <Link
              key={it.href}
              href={it.href}
              className={`flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors ${
                active ? "bg-neutral-900 text-white" : "text-neutral-800 hover:bg-neutral-100"
              }`}
            >
              {it.label}
            </Link>
          );
        })}
      </nav>
    </aside>
  );
}


