SPB Git forge

spb/ai-atlas

Public
41commits 1branches 0releases
4.6 MBsize
maindefault branch
12 days agolast push
HTML 77.2% TypeScript 10.5% Python 9.6% JavaScript 2.5%
2.7 KB · 65 lines tsx
Raw Blame History
1import Link from 'next/link';2import type { ReactNode } from 'react';3import { logoutAction } from '@/lib/admin/actions';4import { AdminNavSelect } from './nav-select';56export const ADMIN_NAV = [7  { href: '/admin/overview', label: 'Overview' },8  { href: '/admin/connectors', label: 'Connectors' },9  { href: '/admin/runs', label: 'Runs' },10  { href: '/admin/errors', label: 'Errors' },11  { href: '/admin/documents', label: 'Documents' },12  { href: '/admin/jobs', label: 'Jobs' },13  { href: '/admin/llm-jobs', label: 'LLM jobs' },14  { href: '/admin/review', label: 'Review queue' },15  { href: '/admin/quality', label: 'Data quality' },16  { href: '/admin/entity-resolution', label: 'Entity resolution' },17  { href: '/admin/anomalies', label: 'Anomalies' },18  { href: '/admin/quarantine', label: 'Quarantine' },19  { href: '/admin/audit', label: 'Audit log' },20  { href: '/admin/entities/duplicates', label: 'Duplicates (v1)' },21  { href: '/admin/infrastructure', label: 'Infrastructure' },22  { href: '/admin/cache', label: 'Cache' },23];2425/** Admin shell: header line + left nav (≥ lg) / select (mobile). Server component; the nav highlight is done by the client select and CSS-less links. */26export function AdminShell({ children, where }: { children: ReactNode; where?: string | null }) {27  return (28    <div className="py-5 md:py-6">29      <div className="mb-4 flex flex-wrap items-center justify-between gap-3 border-b border-rule pb-3">30        <p className="mono text-xs text-ink-3">31          <span className="text-ink">AI Atlas admin</span>32          {where && <span> · {where}</span>}33        </p>34        <div className="flex items-center gap-3 text-xs">35          <Link href="/" className="text-ink-3 hover:text-ink">36            ← public site37          </Link>38          <form action={logoutAction}>39            <button type="submit" className="h-8 border border-rule px-2.5 text-xs text-ink-2 hover:border-rule-strong hover:text-ink">40              Sign out41            </button>42          </form>43        </div>44      </div>45      <div className="grid gap-6 lg:grid-cols-[11rem_minmax(0,1fr)]">46        <aside className="min-w-0">47          <AdminNavSelect items={ADMIN_NAV} />48          <nav aria-label="Admin sections" className="hidden lg:block lg:sticky lg:top-[calc(var(--header-h)+1rem)]">49            <ul className="space-y-px">50              {ADMIN_NAV.map((n) => (51                <li key={n.href}>52                  <Link href={n.href} className="flex min-h-8 items-center px-1 text-sm text-ink-2 hover:bg-surface-2 hover:text-ink">53                    {n.label}54                  </Link>55                </li>56              ))}57            </ul>58          </nav>59        </aside>60        <div className="min-w-0">{children}</div>61      </div>62    </div>63  );64}65