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 { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon"; import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner"; import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry"; import { BomperatorArena } from "@/components/frontend/minigames/bomperator/BomperatorArena"; export const metadata: Metadata = { title: "Ordnance Disposal (Polaris Task Force)", description: "Multiplayer charge-clearing drill: a real-time free-for-all on the depot grid. Last technician standing wins.", }; interface BomperatorPageProps { searchParams: Promise<{ match?: string | string[]; }>; } export default async function BomperatorPage({ searchParams }: BomperatorPageProps) { const headers = await nextHeaders(); const payload = await getPayload({ config: await config }); const { user } = await payload.auth({ headers, canSetHeaders: false }); if (!user) { redirect(`/login?returnTo=${encodeURIComponent("/minigames/bomperator")}`); } const release = await getMinigameReleaseState(payload, "bomperator"); if (release.upcoming && release.game) { return ; } const profileRes = await payload.find({ collection: "profiles", where: { user: { equals: Number(user.id) } }, limit: 1, depth: 0, overrideAccess: true, select: { progression: { minigames: true, }, }, }); const bomp = profileRes.docs[0]?.progression?.minigames?.bomperator ?? {}; const stats = { matchesPlayed: bomp.matchesPlayed ?? 0, matchWins: bomp.matchWins ?? 0, roundsWon: bomp.roundsWon ?? 0, kills: bomp.kills ?? 0, xpEarned: bomp.xpEarned ?? 0, }; const params = await searchParams; const matchValue = params.match; const initialMatchId = Array.isArray(matchValue) ? matchValue[0] : matchValue; return (
{release.game?.status === "phasingOut" && ( )}

Ordnance Disposal

A real-time free-for-all on the depot grid. Grab power-ups from supply stacks, plant charges, and blow your rivals off the field. Last technician standing takes the round.

); }