import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import AlertManager from './component'
import {hideAlert} from 'store/actions'
import {getAlert} from 'store/selectors'

const mapStateToProps = (state) => {
    return {
        alert: getAlert(state),
    }
}

const mapDispatchToProps = (dispatch) => {
    return bindActionCreators(
        {
            hideAlert,
        },
        dispatch
    )
}

export default connect(mapStateToProps, mapDispatchToProps)(AlertManager)
