'use strict';

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

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

var _alerts = require('../../../common/actions/alerts');

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

var _regrading = require('../../../common/actions/regrading');

var _quizEntryRegrades = require('../../api/quizEntryRegrades');

var _constants = require('../../../constants');

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

var _presenter2 = _interopRequireDefault(_presenter);

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

var mapStateToProps = exports.mapStateToProps = function mapStateToProps(state) {
  return {
    modalOpen: state.getIn(['modal', 'isOpen']) === _constants.REGRADE_MODAL,
    regradingPayload: state.getIn(['regrading', 'regradingPayload']),
    scoreReconciliation: state.getIn(['regrading', 'scoreReconciliation'])
  };
};

var mapDispatchToProps = {
  addSuccess: _alerts.addSuccess,
  closeModal: _modal.closeModal,
  createQuizEntryRegrade: _quizEntryRegrades.createQuizEntryRegrade,
  setScoreReconciliation: _regrading.setScoreReconciliation,
  toggleRegradingEditMode: _regrading.toggleRegradingEditMode
};

exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter2.default);