import { RotateCcw, Trophy, X } from 'lucide-react'; import type { GameResult } from '../types'; interface ResultModalProps { result: GameResult; onRestart: () => void; onClose: () => void; } const CONFETTI = Array.from({ length: 26 }, (_, i) => ({ left: `${(i * 37) % 100}%`, delay: `${(i % 8) * 0.09}s`, color: ['#f0b84b', '#e86d4d', '#6878e8', '#38a880'][i % 4], })); export function ResultModal({ result, onRestart, onClose }: ResultModalProps) { const answer = result.heavyBags.length ? result.heavyBags.map((index) => `#${String(index + 1).padStart(2, '0')}`).join(', ') : 'none of them'; return (
The heavy {result.heavyBags.length === 1 ? 'bag was' : 'bags were'} {answer}.
{result.won ? (Compare the extra grams with the coin counts you assigned to each bag.
)}