diff --git a/.gitignore b/.gitignore
index 87cfc77..c1c2679 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,4 @@ pnpm-debug.log*
.idea/
.gitea
-dev/
\ No newline at end of file
+dev/.gitea
diff --git a/src/components/App.jsx b/src/components/App.jsx
index acbc37d..a15375a 100644
--- a/src/components/App.jsx
+++ b/src/components/App.jsx
@@ -117,6 +117,22 @@ const App = () => {
setScreen('game-detail');
}, [currentGameId]);
+ const handleRematch = useCallback(() => {
+ const completedGame = games.find(g => g.id === currentGameId);
+ if (!completedGame) return;
+
+ const newId = handleCreateGame({
+ player1: completedGame.player1,
+ player2: completedGame.player2,
+ player3: completedGame.player3,
+ gameType: completedGame.gameType,
+ raceTo: completedGame.raceTo,
+ });
+
+ setCompletionModal({ open: false, game: null });
+ showGameDetail(newId);
+ }, [games, currentGameId, handleCreateGame, showGameDetail]);
+
// Delete game
const handleDeleteGame = useCallback((id) => {
setModal({ open: true, gameId: id });
@@ -258,6 +274,7 @@ const App = () => {
game={completionModal.game}
onConfirm={handleConfirmCompletion}
onClose={() => setCompletionModal({ open: false, game: null })}
+ onRematch={handleRematch}
/>