Refs #30 - Create src/components/new-game/PlayerSelectModal.tsx - Replace inline modal with imported component in NewGame.tsx - No behavior changes; purely structural extraction
29 lines
892 B
TypeScript
29 lines
892 B
TypeScript
import { h } from 'preact';
|
||
import modalStyles from '../PlayerSelectModal.module.css';
|
||
|
||
interface PlayerSelectModalProps {
|
||
players: string[];
|
||
onSelect: (player: string) => void;
|
||
onClose: () => void;
|
||
}
|
||
|
||
export const PlayerSelectModal = ({ players, onSelect, onClose }: PlayerSelectModalProps) => (
|
||
<div className={modalStyles.modalOverlay} onClick={onClose}>
|
||
<div className={modalStyles.modalContent} onClick={e => e.stopPropagation()}>
|
||
<div className={modalStyles.modalHeader}>
|
||
<h3>Alle Spieler</h3>
|
||
<button className={modalStyles.closeButton} onClick={onClose}>×</button>
|
||
</div>
|
||
<div className={modalStyles.playerList}>
|
||
{players.map(player => (
|
||
<button key={player} className={modalStyles.playerItem} onClick={() => onSelect(player)}>
|
||
{player}
|
||
</button>
|
||
))}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
|
||
|