import { redirect } from 'next/navigation'
import { getSession } from '@/lib/session'
import Link from 'next/link'
export default async function AdminLayout({ children }: { children: React.ReactNode }) {
const session = await getSession()
if (!session || session.role !== 'admin') {
redirect('/')
}
return (
{/* Header */}
{children}
)
}
function AdminTabLink({ href, label, exact }: { href: string; label: string; exact?: boolean }) {
// This is a server component but Next.js doesn't give us pathname here easily.
// We use a client wrapper below.
return
}
// Small client component just for active-state detection
import AdminTabLinkClient from './AdminTabLinkClient'