"use client"; import Link from "next/link"; import { useRouter, usePathname } from "next/navigation"; interface Props { username: string; role: "SUPER_ADMIN" | "ADMIN"; } export default function AdminSidebar({ username, role }: Props) { const router = useRouter(); const pathname = usePathname(); const handleLogout = async () => { await fetch("/api/admin/logout", { method: "POST" }); router.push("/admin/login"); }; const links = [ { href: "/admin/dashboard", label: "Контролна табла" }, ...(role === "SUPER_ADMIN" ? [{ href: "/admin/users", label: "Администратори" }] : []), { href: "/admin/codes", label: "Кодови" }, ]; return ( ); }