import React from 'react' import { useSelector, useDispatch } from 'react-redux' import { HiOutlineArrowNarrowRight } from 'react-icons/hi' import axios from 'axios' import { setStyle } from '../redux/reducers/styleSlice' const Alert = ({ onTop = false }) => { const styleState = useSelector(state => state.style) const dispatch = useDispatch() const display = styleState?.style?.alert?.show ? 'flex' : 'none' function clicked() { if (styleState.style.alert.button.action === 'play_again') { axios.get(`/api/blackjack?action=play_again&session_id=${localStorage.CAESSINO_SESSION_ID}`); } else if (styleState.style.alert.button.action === 'continue_from_side_bet') { axios.get(`/api/blackjack?action=continue_from_side_bet&session_id=${localStorage.CAESSINO_SESSION_ID}`); } else { dispatch(setStyle({ ...styleState.style, alert: { ...styleState.style.alert, show: false } })) } } return (

{styleState.style.alert.title}

{styleState.style.alert.subtitle}

) } export default Alert