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 { Bomb } from "lucide-react"; import { EodArena } from "@/components/frontend/eod/EodArena"; export const metadata: Metadata = { title: "Minefield Clearance (Polaris Task Force)", description: "Clear simulated minefields across three EOD sectors to earn XP for the task force.", }; export default async function EodPage() { 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("/eod")}`); } 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 eod = profileRes.docs[0]?.progression?.minigames?.eodMinesweeper ?? {}; const stats = { gamesPlayed: eod.gamesPlayed ?? 0, wins: eod.wins ?? 0, losses: eod.losses ?? 0, bestScore: eod.bestScore ?? 0, eodXp: eod.xpEarned ?? 0, xpEarned: 0, bestTrainingTime: eod.bestTrainingTime ?? 0, bestPerimeterTime: eod.bestPerimeterTime ?? 0, bestSupplyRoadTime: eod.bestSupplyRoadTime ?? 0, }; return (

Minefield Clearance

Clear the minefield to earn XP. Faster clears score higher.

); }