diff --git a/src/components/GameAnalysisModal.tsx b/src/components/GameAnalysisModal.tsx index 5592f18..cbce918 100644 --- a/src/components/GameAnalysisModal.tsx +++ b/src/components/GameAnalysisModal.tsx @@ -5,12 +5,13 @@ import { Stockfish, StockfishEvaluation } from "@/lib/stockfish"; import { OpeningMetadata, lookupOpening } from "@/lib/openings"; import { getGenAIModel } from "@/lib/gemini"; import { Loader2, X, Brain, Trophy, AlertTriangle } from "lucide-react"; +import { SupportedLanguage } from "@/lib/i18n/translations"; interface GameAnalysisModalProps { fen: string; stockfish: Stockfish | null; apiKey: string | null; - language: 'en' | 'de' | 'fr' | 'it'; + language: SupportedLanguage; onClose: () => void; } diff --git a/src/components/GameImportModal.tsx b/src/components/GameImportModal.tsx index 0b9961f..361a329 100644 --- a/src/components/GameImportModal.tsx +++ b/src/components/GameImportModal.tsx @@ -4,11 +4,12 @@ import { useState, useEffect } from "react"; import { Chessboard } from "react-chessboard"; import { X, Loader2, Download, ExternalLink } from "lucide-react"; import { fetchChessComGames, fetchLichessGames, GameMetadata, Platform } from "@/lib/gameImport"; +import { SupportedLanguage } from "@/lib/i18n/translations"; interface GameImportModalProps { onClose: () => void; onSelectGame: (pgn: string) => void; - language: 'en' | 'de' | 'fr' | 'it'; + language: SupportedLanguage; } export function GameImportModal({ onClose, onSelectGame, language }: GameImportModalProps) { diff --git a/src/components/GameOverModal.tsx b/src/components/GameOverModal.tsx index 9c4ed20..1a4896b 100644 --- a/src/components/GameOverModal.tsx +++ b/src/components/GameOverModal.tsx @@ -6,6 +6,7 @@ import { Loader2, X, Trophy, AlertTriangle, RefreshCw } from "lucide-react"; import { StockfishEvaluation } from "@/lib/stockfish"; import { DetectedTactic } from "@/lib/tacticDetection"; import ReactMarkdown from "react-markdown"; +import { SupportedLanguage } from "@/lib/i18n/translations"; export interface MoveHistoryItem { moveNumber: number; @@ -50,7 +51,7 @@ interface GameOverModalProps { winner: "White" | "Black" | "Draw"; history: MoveHistoryItem[]; apiKey: string | null; - language: 'en' | 'de' | 'fr' | 'it'; + language: SupportedLanguage; onClose: () => void; onNewGame: () => void; } diff --git a/src/components/StartScreen.tsx b/src/components/StartScreen.tsx index 4842a41..f90013c 100644 --- a/src/components/StartScreen.tsx +++ b/src/components/StartScreen.tsx @@ -85,11 +85,7 @@ export default function StartScreen({ onStartGame, onResumeGame, savedGames, onD return t.start.noEvaluation; }; - useEffect(() => { - if (!hasSavedGames) { - setShowNewGameOptions(true); - } - }, [hasSavedGames]); + if (!mounted) return null; @@ -118,18 +114,24 @@ export default function StartScreen({ onStartGame, onResumeGame, savedGames, onD