import LifeCounter from '../LifeCounter/LifeCounter'; import { Player as PlayerType } from '../../Types/Player'; import { twc } from 'react-twc'; const getGridArea = (player: PlayerType) => { switch (player.index) { case 0: return 'grid-in-player0'; case 1: return 'grid-in-player1'; case 2: return 'grid-in-player2'; case 3: return 'grid-in-player3'; case 4: return 'grid-in-player4'; case 5: return 'grid-in-player5'; default: throw new Error('Invalid player index'); } }; const PlayerWrapper = twc.div`w-full h-full bg-black`; export const Player = (players: PlayerType[], gridClasses: string) => { return (
{players.map((player) => { const gridArea = getGridArea(player); return (
opponent.index !== player.index )} />
); })}
); };