import { Card, CardInner } from "@/components/Card"; import { WordWrangler } from "@/components/Game/WordWrangler"; import { StartGameButton } from "@/components/StartButton"; import { GAME_TEXT } from "@/constants/gameConstants"; import { useConfigurationSettings } from "@/contexts/Configuration"; import { PERSONALITY_PRESETS, PersonalityType } from "@/types/personality"; import { IconArrowForwardUp, IconCheck, IconCode, IconX, } from "@tabler/icons-react"; import JSConfetti from "js-confetti"; import Image from "next/image"; import Link from "next/link"; import { useEffect, useState } from "react"; import Logo from "../assets/logo.png"; import Star from "../assets/star.png"; export default function Home() { const [hasStarted, setHasStarted] = useState(false); const [gameEnded, setGameEnded] = useState(false); const [score, setScore] = useState(0); const [bestScore, setBestScore] = useState(0); const config = useConfigurationSettings(); useEffect(() => { if (gameEnded) { const confetti = new JSConfetti(); confetti.addConfetti({ emojis: ["⭐", "⚡️", "👑", "✨", "💫", "🏆", "💯"], }); } }, [gameEnded]); if (gameEnded) { return (
{score}
{GAME_TEXT.finalScoreMessage}{" "} {bestScore}