import React from 'react' import { useSelector, useDispatch } from 'react-redux' import { setStyle } from '../redux/reducers/styleSlice'; import { AiOutlineClose } from 'react-icons/ai'; import { setPlayer } from '../redux/reducers/playerSlice'; import axios from 'axios'; const ManageCredits = () => { const playerState = useSelector(state => state.player); const styleState = useSelector(state => state.style); const dispatch = useDispatch(); function close() { dispatch(setStyle({ ...styleState.style, displayManageCreditsScreen: false, })) } function buyCredits() { axios.get(`/api/postgre/?action=add_credits&session_id=${localStorage.CAESSINO_SESSION_ID}&credits=${500}&dont_update_stats=true`).then(res => { if (res.data?.success) { dispatch(setPlayer({ ...playerState.player, credits: res.data.credits, })) } }); } return (
You currently have: ${playerState.player.credits}