import { setPlayer, type Player, type ScoreboardState } from '@sbt/shared'; import { ScoreBug } from './ScoreBug'; import { PlayerPanel } from './PlayerPanel'; import { MatchControls } from './MatchControls'; /** * Live preview + full editing controls. Shared by the owner Editor and the no-login * Control page — both just provide `state` and an `onChange` that pushes over WebSocket. */ export function Workspace({ state, onChange, connected, }: { state: ScoreboardState; onChange: (next: ScoreboardState) => void; connected: boolean; }) { const patchPlayer = (index: 0 | 1, patch: Partial) => onChange(setPlayer(state, index, patch)); return (
patchPlayer(0, p)} /> patchPlayer(1, p)} />
); } function ConnectionDot({ connected }: { connected: boolean }) { return ( {connected ? 'Live — changes sync instantly' : 'Reconnecting…'} ); }