import { notFound, redirect } from "next/navigation"; import { NavLink } from "@/components/header-client"; import { getMe, isModerator, type Person } from "@/lib/api"; /** The signed-in moderator, or off to sign in; others get not found (the console isn't for them). */ export async function requireModerator(path: string): Promise { const me = await getMe(); if (!me) redirect(`/signin?next=${encodeURIComponent(path)}`); if (!isModerator(me)) notFound(); return me; } export function ConsoleNav() { return ( ); }