"use client"; import type { ReactNode } from "react"; import { useRouter } from "next/navigation"; export function ArcadeGameShell({ title, exitHref, elapsedSeconds, complete, worldClassName = "connections-world connections-stage", children, }: { title: string; exitHref: string; elapsedSeconds: number; complete: boolean; worldClassName?: string; children: ReactNode; }) { const router = useRouter(); function exitGame() { if (!complete && !window.confirm("Leave this round? Your progress will not be saved.")) return; router.push(exitHref); } const minutes = Math.floor(elapsedSeconds / 60); const seconds = String(elapsedSeconds % 60).padStart(2, "0"); return (

{title}

{minutes}:{seconds}
{children}
); }