import type { Metadata } from 'next'; import type { ReactNode } from 'react'; import { AdminShell } from '@/components/admin/shell'; import { Container } from '@/components/ui/section'; import { getAdminToken } from '@/lib/admin/session'; export const metadata: Metadata = { title: { default: 'Admin', template: '%s ยท Admin | AI Atlas' }, robots: { index: false, follow: false, nocache: true } }; export const dynamic = 'force-dynamic'; /** Admin shell when a session cookie exists; bare (login form) otherwise. Every page still validates the token on its own fetches. */ export default async function AdminLayout({ children }: { children: ReactNode }) { const token = await getAdminToken(); return {token ? {children} : children}; }