import Link from "next/link";
import { requireAdmin } from "@/lib/session-helpers";

export default async function AdminLayout({ children }: { children: React.ReactNode }) {
  await requireAdmin();

  return (
    <section className="section">
      <div className="container layout-split">
        <aside className="side-nav" aria-label="Administration">
          <strong style={{ display: "block", padding: "0.35rem 0.65rem", marginBottom: "0.35rem" }}>
            Admin
          </strong>
          <Link href="/admin">Übersicht</Link>
          <Link href="/admin/users">Nutzer</Link>
          <Link href="/admin/landing">Startseite</Link>
          <Link href="/admin/courses">Kurse</Link>
          <Link href="/portal">Mitgliederbereich</Link>
          <Link href="/">Öffentliche Website</Link>
        </aside>
        <div>{children}</div>
      </div>
    </section>
  );
}
