import { Button } from "@/components/ui/button"; import { motion } from "framer-motion"; import { useEffect, useState } from "react"; interface WordDisplayProps { currentWord: string; successfulRounds: number; onContinue: () => void; } export const WordDisplay = ({ currentWord, successfulRounds, onContinue }: WordDisplayProps) => { const [imageLoaded, setImageLoaded] = useState(false); const imagePath = `/think_in_sync_assets/${currentWord.toLowerCase()}.jpg`; useEffect(() => { const img = new Image(); img.onload = () => setImageLoaded(true); img.src = imagePath; console.log("Attempting to load image:", imagePath); }, [imagePath]); return (

Your Word

{imageLoaded && ( {currentWord} )}

{currentWord}

{successfulRounds > 0 && (

Successful rounds: {successfulRounds}

)}

You'll take turns with AI to create a sentence that describes this word.

Click the "Make AI Guess" button to see if another AI can guess it!

); };