import { motion } from 'framer-motion'; import type { Player } from '@shared/types'; interface TargetSelectModalProps { players: Player[]; onClose: () => void; } export function TargetSelectModal({ players, onClose }: TargetSelectModalProps) { const handleSelect = (playerId: string) => { // Call the callback set by GameBoard // The callback returns true if we should NOT close (e.g., opening another modal) const callback = (window as any).__targetSelectCallback; if (callback) { const keepOpen = callback(playerId); if (keepOpen) return; // Don't close if another modal is being opened } onClose(); }; return ( e.stopPropagation()} >

🎯 Select Target

Choose an opponent

{players.map((player, index) => ( handleSelect(player.id)} initial={{ opacity: 0, x: -20 }} animate={{ opacity: 1, x: 0 }} transition={{ delay: index * 0.1 }} whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} >
{player.name.charAt(0).toUpperCase()}
{player.name}
{player.cardCount} cards
))}
); }