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'; 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 (
You have chosen to bet on: {styleState.roulette.whichBets.map((bet, i) => `${bet} `)}
Please select the amount you will bet