import { createContext, useContext } from "react"; import type { Game } from "./game"; /** The game on this device, for the few screens that need more than commands (debug info). */ export const GameContext = createContext(null); /** The game, or null outside `GameRoot` (component tests). */ export function useGame(): Game | null { return useContext(GameContext); }