"use strict";

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

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

var _immutable = require("immutable");

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

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

var _Bank = _interopRequireDefault(require("../../../common/records/Bank"));

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

var _banks = require("../../api/banks");

function mapStateToProps(state, props) {
  return {
    appContainer: state.getIn(['ui', 'appContainer']),
    banks: (0, _immutable.List)(props.recordIds).map(function (id) {
      return _Bank.default.create(state.getIn(['banks', id]));
    })
  };
}

var _default = (0, _reactRedux.connect)(mapStateToProps, {
  openModal: _modal.openModal,
  deleteBank: _banks.deleteBank,
  withConfirm: _modal.withConfirm
})(_presenter.default);

exports.default = _default;