import { type ScoreboardState } from '@sbt/shared'; import { uploadImage } from '../api'; import { Button, Field, Input } from './ui'; /** Match-wide controls: side swap, best-of, center callout, logo, theme colors. */ export function MatchControls({ state, onChange, }: { state: ScoreboardState; onChange: (next: ScoreboardState) => void; }) { const set = (patch: Partial) => onChange({ ...state, ...patch }); const onLogo = async (file?: File) => { if (!file) return; const url = await uploadImage(file); set({ eventLogoUrl: url }); }; return (
Match
set({ centerCallout: e.target.value })} /> set({ bestOf: Number(e.target.value) || 0 })} />
onLogo(e.target.files?.[0])} className="text-xs" /> {state.eventLogoUrl && ( )}
set({ theme: { ...state.theme, accent: e.target.value } })} className="h-9 w-full rounded border border-edge bg-ink" /> set({ theme: { ...state.theme, bg: e.target.value } })} className="h-9 w-full rounded border border-edge bg-ink" />
); }