SPB Git forge

spb/polyllm

Public
15commits 1branches 0releases
2.2 MBsize
maindefault branch
13 days agolast push
TypeScript 97.4% SQL 1% JavaScript 0.9% CSS 0.6%
1.6 KB · 33 lines tsx
Raw Blame History
1import Link from "next/link";2import { ArrowLeft, ShieldCheck } from "lucide-react";3import { requireAdmin } from "@/lib/session";4import { Logo } from "@/components/brand/logo";56export const dynamic = "force-dynamic";78export default async function AdminLayout({ children }: { children: React.ReactNode }) {9  const user = await requireAdmin();10  return (11    <div className="min-h-dvh bg-bg text-fg">12      <header className="sticky top-0 z-30 border-b border-border glass">13        <div className="mx-auto flex h-12 w-full max-w-6xl items-center justify-between gap-3 px-4 sm:px-6 lg:px-8">14          <div className="flex items-center gap-3">15            <Link href="/app" className="inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[13px] text-fg-muted transition-colors hover:bg-bg-muted hover:text-fg">16              <ArrowLeft className="size-4" /> Back to app17            </Link>18            <span className="hidden h-4 w-px bg-border sm:block" aria-hidden />19            <Logo size={20} className="hidden sm:inline-flex" />20          </div>21          <div className="flex items-center gap-2 text-xs text-fg-muted">22            <span className="inline-flex items-center gap-1 rounded-full border border-border bg-bg-subtle px-2 py-0.5 text-[11px] font-medium">23              <ShieldCheck className="size-3 text-accent" /> Admin24            </span>25            <span className="hidden truncate sm:inline">{user.email}</span>26          </div>27        </div>28      </header>29      <main className="mx-auto w-full max-w-6xl px-4 py-6 sm:px-6 lg:px-8">{children}</main>30    </div>31  );32}33