'use strict';

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

var _immutable = require('immutable');

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

var _presenter = require('./presenter');

var _presenter2 = _interopRequireDefault(_presenter);

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

var _Bank2 = _interopRequireDefault(_Bank);

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

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

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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

exports.default = (0, _reactRedux.connect)(mapStateToProps, {
  openModal: _modal.openModal,
  deleteBank: _banks.deleteBank,
  withConfirm: _modal.withConfirm
})(_presenter2.default);