import type { Metadata } from "next"; import config from "@payload-config"; import { getPayload } from "payload"; import { headers as nextHeaders } from "next/headers"; import { redirect } from "next/navigation"; import { ScrollText } from "lucide-react"; import { OpordArena } from "@/components/frontend/opord/OpordArena"; export const metadata: Metadata = { title: "OPORD Recall (Polaris Task Force)", description: "Study a live operations order, then recall the details under pressure.", }; export default async function OpordPage() { const headers = await nextHeaders(); const payloadConfig = await config; const payload = await getPayload({ config: payloadConfig }); const { user } = await payload.auth({ headers, canSetHeaders: false }); if (!user) { redirect(`/login?returnTo=${encodeURIComponent("/opord")}`); } const profileRes = await payload.find({ collection: "profiles", where: { user: { equals: user.id as number } }, limit: 1, depth: 0, overrideAccess: true, select: { progression: { minigames: true, }, }, }); const opordRecall = profileRes.docs[0]?.progression?.minigames?.opordRecall ?? {}; const stats = { gamesPlayed: opordRecall.gamesPlayed ?? 0, bestScore: opordRecall.bestScore ?? 0, bestAccuracy: opordRecall.bestAccuracy ?? 0, recruitBestScore: opordRecall.recruitBestScore ?? 0, veteranBestScore: opordRecall.veteranBestScore ?? 0, eliteBestScore: opordRecall.eliteBestScore ?? 0, opordRecallXp: opordRecall.xpEarned ?? 0, xpEarned: 0, score: 0, accuracy: 0, }; return (

OPORD Recall

Study a live operations order, then recall the details under pressure.

); }