10 lines
416 B
TypeScript
10 lines
416 B
TypeScript
import { createContext, useContext } from "react";
|
|
import type { HudElementId, HudElementLayout } from "../game/uiLayout";
|
|
|
|
export const HudSurfaceContext = createContext<{
|
|
surface: "top" | "bottom";
|
|
onChange?: (id: HudElementId, update: Partial<HudElementLayout>) => void;
|
|
onResurrect?: (checkpointId: string) => void;
|
|
}>({ surface: "top" });
|
|
export const useHudSurface = () => useContext(HudSurfaceContext);
|