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

Winners:


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

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

: ))}

Losers:


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

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

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

Online:


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

{player.name}

: ))}

Betted:


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

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

: ))}
) } } export default PlayersDisplay