import { connect } from 'react-redux'
import { closeSnackbar } from '../actions/SnackbarActions'
import RootSnackbar from '../components/RootSnackbar'

const mapStateToProps = (state) => ({
  open: state.snackbar.open,
  message: state.snackbar.message,
})

const mapDispatchToProps = dispatch => ({
  close: () => dispatch(closeSnackbar())
})


const SnackbarContainer = connect(
  mapStateToProps,
  mapDispatchToProps
)(RootSnackbar)

export default SnackbarContainer