import React from 'react' import { GiTwoCoins } from 'react-icons/gi' import { AiOutlineClose } from 'react-icons/ai' import { useSelector, useDispatch } from 'react-redux' import { setRoulette } from '../../redux/reducers/styleSlice'; import axios from 'axios'; import { setPlayer, setRouletteGame } from '../../redux/reducers/playerSlice'; const BetModal = () => { const dispatch = useDispatch(); const playerState = useSelector(state => state.player); const styleState = useSelector(state => state.style); function chooseBet(e) { dispatch(setRoulette({ ...styleState.roulette, inputControls: { ...styleState.roulette.inputControls, bet: { ...styleState.roulette.inputControls.bet, chosenCredits: parseInt(e.target.value), } } })); } function placeBet() { axios.get(`/api/roulette?action=place_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&betAmount=${styleState.roulette.inputControls.bet.chosenCredits}&whichBets=${styleState.roulette.whichBets.toString()}&coinPlacedX=${styleState.roulette.coinPlaced.x}&coinPlacedY=${styleState.roulette.coinPlaced.y}`); closeModal(); } function closeModal() { dispatch(setRoulette({ ...styleState.roulette, displays: { ...styleState.roulette.displays, betModal: false, }, })); } return (
10 && playerState.rouletteGame.game.timeToStart <= playerState.rouletteGame.game.COUNTDOWN_FROM ? 'flex' : 'none'}}>

You have chosen to bet on: {styleState.roulette.whichBets.map((bet, i) => `${bet} `)}
Please select the amount you will bet

chooseBet(e)} />
${styleState.roulette.inputControls.bet.chosenCredits}

) } export default BetModal