This commit is contained in:
Maciej Caderek
2022-04-13 03:26:01 +02:00
parent c99d4f4f24
commit 540f8f1941

View File

@@ -20,7 +20,11 @@ const Moves: Component<{
<Scrollable class={"moves" + (props.class ? ` ${props.class}` : "")}> <Scrollable class={"moves" + (props.class ? ` ${props.class}` : "")}>
<Show when={props.moves.length === 0}> <Show when={props.moves.length === 0}>
<p class="moves__turn"> <p class="moves__turn">
{state.game.getPosition(0).turn === "w" ? "White" : "Black"} to move. {state.game.getPosition(0).mate
? "Checkmate."
: state.game.getPosition(0).turn === "w"
? "White to move."
: "Black to move."}
</p> </p>
</Show> </Show>
<For each={chunk_(2, props.moves as string[])}> <For each={chunk_(2, props.moves as string[])}>