import {connect} from 'react-redux';
import Dialog from '../components/Dialog';
import {remove_dialog_msg} from '../actions'

const mapStateToProps = (state) => ({
	obj: state.dialog[0] || null
});

const mapDispatchToProps = (dispatch, ownProps) => ({
	getNext : (act) => {
		//get next dialog message
		if(typeof act == 'function') act();
		dispatch(remove_dialog_msg());
	}
});

export default connect(mapStateToProps, mapDispatchToProps)(Dialog);