import { Button } from "@/components/ui/button"; import { motion } from "framer-motion"; import { Dialog, DialogContent, DialogTrigger, } from "@/components/ui/dialog"; import { HighScoreBoard } from "@/components/HighScoreBoard"; import { useState } from "react"; import { useTranslation } from "@/hooks/useTranslation"; interface GuessDisplayProps { sentence: string[]; aiGuess: string; currentWord: string; onNextRound: () => void; onPlayAgain: () => void; currentScore: number; avgWordsPerRound: number; } export const GuessDisplay = ({ sentence, aiGuess, currentWord, onNextRound, onPlayAgain, currentScore, avgWordsPerRound, }: GuessDisplayProps) => { const isGuessCorrect = () => aiGuess.toLowerCase() === currentWord.toLowerCase(); const [isDialogOpen, setIsDialogOpen] = useState(false); const t = useTranslation(); return (

{t.guess.title}

{t.guess.sentence}: {sentence.join(" ")}

{t.guess.aiGuessed}: {aiGuess}

{isGuessCorrect() ? ( {t.guess.correct} ) : ( {t.guess.incorrect} )}

{isGuessCorrect() ? ( ) : ( <> setIsDialogOpen(false)} onPlayAgain={() => { setIsDialogOpen(false); onPlayAgain(); }} /> )}
); };