"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _redux = require("redux");

var _immutable = require("immutable");

var _reactRedux = require("../../react-redux");

var _modal = require("../../actions/modal");

var _presenter = _interopRequireDefault(require("./presenter"));

var mapStateToProps = function mapStateToProps(state) {
  var modal = state.get('modal');
  return {
    modalOpen: !!modal.get('isOpen') && modal.get('isOpen') === modal.getIn(['options', 'title']),
    modalOptions: modal.get('options') || (0, _immutable.Map)()
  };
};

var mapDispatchToProps = function mapDispatchToProps(dispatch) {
  return {
    closeModal: (0, _redux.bindActionCreators)(_modal.closeModal, dispatch)
  };
};

var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter.default);

exports.default = _default;