Show default chess control detail in room summary
- Use the selected chess time control detail when available - Fall back to a balanced default description when no match is found
This commit is contained in:
@@ -142,7 +142,8 @@ function CreateRoomDialog({
|
|||||||
if (!show) return null;
|
if (!show) return null;
|
||||||
|
|
||||||
const selectedGame = configGame ? gameUIRegistry.get(configGame) : null;
|
const selectedGame = configGame ? gameUIRegistry.get(configGame) : null;
|
||||||
const selectedChessControl = CHESS_TIME_CONTROLS.find(control => control.key === chessTimeControl) ?? CHESS_TIME_CONTROLS[0];
|
const selectedChessControl = CHESS_TIME_CONTROLS.find(control => control.key === chessTimeControl);
|
||||||
|
const selectedChessControlDetail = selectedChessControl?.detail ?? "Balanced default for most quick matches.";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -271,7 +272,7 @@ function CreateRoomDialog({
|
|||||||
<div className={cn("rounded-3xl border p-4", gameSurfaceClass("chess"))}>
|
<div className={cn("rounded-3xl border p-4", gameSurfaceClass("chess"))}>
|
||||||
<div className="text-[11px] uppercase tracking-[0.2em] text-text-disabled">Room Summary</div>
|
<div className="text-[11px] uppercase tracking-[0.2em] text-text-disabled">Room Summary</div>
|
||||||
<div className="mt-3 text-lg font-semibold text-foreground">{CHESS_TIME_CONTROL_LABELS[chessTimeControl]}</div>
|
<div className="mt-3 text-lg font-semibold text-foreground">{CHESS_TIME_CONTROL_LABELS[chessTimeControl]}</div>
|
||||||
<div className="mt-1 text-sm text-text-tertiary">{selectedChessControl.detail}</div>
|
<div className="mt-1 text-sm text-text-tertiary">{selectedChessControlDetail}</div>
|
||||||
<div className="mt-4 space-y-3 text-sm text-text-secondary">
|
<div className="mt-4 space-y-3 text-sm text-text-secondary">
|
||||||
<div className="flex items-center justify-between gap-3">
|
<div className="flex items-center justify-between gap-3">
|
||||||
<span>Launch</span>
|
<span>Launch</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user