pass ply change to callback

This commit is contained in:
2026-06-02 14:24:17 +02:00
parent 42ef8f20e0
commit b8bd48885e
4 changed files with 22 additions and 8 deletions
+6
View File
@@ -7,6 +7,11 @@ export const useChessGame = () => {
const [gameState, gameDispatch] = useReducer(gameReducer, initialGameState);
const fileInputRef = useRef<HTMLInputElement | null>(null);
const handlePlyChange = ({ ply, fen }: { ply: number; fen: string }) => {
console.log("Ply change", ply, fen);
return;
};
const handleSavePgn = () => {
const pgnString = buildPgnString(gameState);
downloadString(pgnString, "game.pgn");
@@ -84,6 +89,7 @@ export const useChessGame = () => {
handleClearGame,
handleLoadPgn,
handleToggleClock,
handlePlyChange,
handleToggleDiagram,
};
};