import { motion } from 'framer-motion'; import { useGameStore } from '../../store/gameStore'; import { emitLeaveRoom } from '../../socket/socket'; interface GameOverModalProps { winnerId?: string; winnerName?: string; onClose: () => void; } export function GameOverModal({ winnerId, winnerName, onClose }: GameOverModalProps) { const playerId = useGameStore((state) => state.playerId); const reset = useGameStore((state) => state.reset); const isWinner = winnerId === playerId; const handleLeave = () => { emitLeaveRoom(); reset(); onClose(); }; return ( e.stopPropagation()} > {isWinner ? ( <> 🏆

YOU WIN!

مبروك! انت الفائز

You survived the mummies! ) : ( <> 👑

GAME OVER

{winnerName} wins!

Better luck next time!

)} {/* Confetti effect for winner */} {isWinner && (
{Array.from({ length: 50 }).map((_, i) => ( ))}
)}
); }