import React from 'react' import { useSelector } from 'react-redux' const PlayersDisplay = () => { const playerState = useSelector(state => state.player); // See results. if (playerState.rouletteGame.game.timeToStart > playerState.rouletteGame.game.COUNTDOWN_FROM) { return (

Winners:


{playerState.rouletteGame?.game.players.map((player, i) => ( player.betAmount > 0 && player.outcome === 'won' ?

{player.name} [{player.whichBets.toString()}]

: ))}

Losers:


{playerState.rouletteGame?.game.players.map((player, i) => ( player.betAmount > 0 && player.outcome === 'lost' ?

{player.name} [{player.whichBets.toString()}]

: ))}
) } // See who betted. else { return (

Online:


{playerState.rouletteGame?.game.players.map((player, i) => ( player.status.substr(1, 1) === '1' ?

{player.name}

: ))}

Betted:


{playerState.rouletteGame?.game.players.map((player, i) => ( player.status.substr(1, 1) === '2' ?

{player.name} [{player.whichBets.toString()}]

: ))}
) } } export default PlayersDisplay