import type { DigitCompletion } from "../state/gameplayHelpers"; import { symbolFor } from "../state/session"; function completionLabel(item: DigitCompletion, size: number): string { const symbol = symbolFor(item.digit, size); if (item.status === "done") return `Digit ${symbol}: complete, ${String(item.placed)} of ${String(item.target)} placed`; if (item.status === "overdone") return `Digit ${symbol}: overdone by ${String(item.excess)}, ${String(item.placed)} of ${String(item.target)} placed`; return `Digit ${symbol}: ${String(item.remaining)} remaining, ${String(item.placed)} of ${String(item.target)} placed`; } export function DigitCompletionBar({ size, completions, highlightedDigit, highlightingEnabled, onHighlight, }: { size: number; completions: readonly DigitCompletion[]; highlightedDigit: number | null; highlightingEnabled: boolean; onHighlight: (digit: number) => void; }) { return (
Digit progress muted = complete ยท red = too many
9 ? " digit-completion__bar--wide" : ""}`} role="group" aria-label="Highlight matching digits" > {completions.map((item) => ( ))}
); }