SPB Git

spb/ai-atlas

Public
871 B · 15 lines tsx
1import type { Metadata } from 'next';2import type { ReactNode } from 'react';3import { AdminShell } from '@/components/admin/shell';4import { Container } from '@/components/ui/section';5import { getAdminToken } from '@/lib/admin/session';67export const metadata: Metadata = { title: { default: 'Admin', template: '%s · Admin | AI Atlas' }, robots: { index: false, follow: false, nocache: true } };8export const dynamic = 'force-dynamic';910/** Admin shell when a session cookie exists; bare (login form) otherwise. Every page still validates the token on its own fetches. */11export default async function AdminLayout({ children }: { children: ReactNode }) {12  const token = await getAdminToken();13  return <Container wide>{token ? <AdminShell where={process.env.NODE_ENV === 'production' ? 'production' : 'development'}>{children}</AdminShell> : children}</Container>;14}15
Files · 0f064299de6124ef553ef1bf8a851ae63aeae373
Menu

Theme