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"; 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); return (

AI's Guess

Your sentence: {sentence.join(" ")}

AI guessed: {aiGuess}

{isGuessCorrect() ? ( Correct guess! 🎉 Ready for the next round? Press Enter ) : ( Game Over! Press Enter to play again )}

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