import { jsxs, jsx } from 'react/jsx-runtime';
import 'react';
import { u as useAuth } from './AdminAuth_CWvmd3cU.mjs';

const navItems = [
  { href: "/admin", label: "Dashboard", icon: "📊" },
  { href: "/admin/revenue", label: "Revenue", icon: "💰" },
  { href: "/admin/performance", label: "Performance", icon: "🔥" },
  { href: "/admin/homepage", label: "Homepage", icon: "🏠" },
  { href: "/admin/feeds", label: "Feeds", icon: "📡" },
  { href: "/admin/feeds/health", label: "Feed Health", icon: "🩺" },
  { href: "/admin/products", label: "Products", icon: "📦" },
  { href: "/admin/collections", label: "Collections", icon: "📁" },
  { href: "/admin/analytics", label: "Analytics", icon: "📈" },
  { href: "/admin/emails", label: "Email", icon: "📧" },
  { href: "/admin/emails/editor", label: "Email Editor", icon: "✏️" },
  { href: "/admin/crons", label: "Crons", icon: "⏰" }
];
function NavLink({ href, label, icon }) {
  const active = typeof window !== "undefined" && (window.location.pathname === href || href !== "/admin" && window.location.pathname.startsWith(href));
  return /* @__PURE__ */ jsxs(
    "a",
    {
      href,
      className: `flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm transition-colors
        ${active ? "bg-[#00FF6A]/10 text-[#00FF6A]" : "text-[#999] hover:text-[#F5F5F5] hover:bg-[#1A1A1A]"}`,
      children: [
        /* @__PURE__ */ jsx("span", { className: "text-base", children: icon }),
        /* @__PURE__ */ jsx("span", { children: label })
      ]
    }
  );
}
function AdminLayout({ children, title }) {
  const { user, logout } = useAuth();
  return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen bg-[#0A0A0A]", children: [
    /* @__PURE__ */ jsxs("aside", { className: "w-60 border-r border-[#333] flex flex-col", children: [
      /* @__PURE__ */ jsx("div", { className: "p-4 border-b border-[#333]", children: /* @__PURE__ */ jsxs("a", { href: "/admin", className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsx("span", { className: "text-[#00FF6A] font-bold text-lg font-[var(--font-display)]", children: "SneakerPicks" }),
        /* @__PURE__ */ jsx("span", { className: "text-xs text-[#666] bg-[#1A1A1A] px-2 py-0.5 rounded", children: "Admin" })
      ] }) }),
      /* @__PURE__ */ jsx("nav", { className: "flex-1 p-3 space-y-1", children: navItems.map((item) => /* @__PURE__ */ jsx(NavLink, { ...item }, item.href)) }),
      /* @__PURE__ */ jsxs("div", { className: "p-4 border-t border-[#333]", children: [
        /* @__PURE__ */ jsx("div", { className: "text-xs text-[#666] mb-2", children: user?.email }),
        /* @__PURE__ */ jsx("button", { onClick: logout, className: "text-xs text-[#999] hover:text-[#FF3B3B] transition-colors", children: "Uitloggen" })
      ] })
    ] }),
    /* @__PURE__ */ jsxs("main", { className: "flex-1 overflow-auto", children: [
      /* @__PURE__ */ jsx("header", { className: "border-b border-[#333] px-8 py-4", children: /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-[#F5F5F5]", children: title }) }),
      /* @__PURE__ */ jsx("div", { className: "p-8", children })
    ] })
  ] });
}

export { AdminLayout as A };
