import { notFound } from "next/navigation"; import { randomUUID } from "node:crypto"; import { ARCADE_RENDERERS } from "@/components/arcade/rendererRegistry"; import { getArcadePack } from "@/services/arcadeService"; export default async function ConnectionsPlayPage( props: PageProps<"/[classSlug]/arcade/connections/[packId]/play"> ) { const [{ classSlug, packId }, query] = await Promise.all([props.params, props.searchParams]); const pack = await getArcadePack(packId); if (!pack || pack.class.slug !== classSlug || pack.gameType !== "connections" || pack.normalized.type !== "connections") notFound(); const normalized = pack.normalized; const mistakesValue = Number(query.mistakes); const allowedMistakes = Number.isInteger(mistakesValue) && mistakesValue >= 1 && mistakesValue <= 8 ? mistakesValue : normalized.settings.allowedMistakes; const Renderer = ARCADE_RENDERERS.connections; return ; }