import { Button } from "@/components/ui/button"; import { motion } from "framer-motion"; import { useEffect, useState } from "react"; import { useIsMobile } from "@/hooks/use-mobile"; 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`; const isMobile = useIsMobile(); useEffect(() => { if (!isMobile) { const img = new Image(); img.onload = () => setImageLoaded(true); img.src = imagePath; console.log("Attempting to load image:", imagePath); } }, [imagePath, isMobile]); return (

Your Word

{!isMobile && 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!

); };