'use strict';

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

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

var _makeEditable = require('../../../shared/functionality/makeEditable');

var _makeEditable2 = _interopRequireDefault(_makeEditable);

var _errorsShowing = require('../../../../actions/errorsShowing');

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

var _modifications = require('../../../../actions/modifications');

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

var _presenter2 = _interopRequireDefault(_presenter);

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

function mapStateToProps(state, props) {
  // Error Related:
  var workingEntry = props.entry.getWorkingInstance();
  var isValid = props.isValid !== void 0 ? props.isValid : workingEntry.isValid();
  return {
    isValid: isValid
  };
}

var mapDispatchToProps = {
  clearNextQuizEntry: _modifications.clearNextQuizEntry,
  showError: _errorsShowing.showError,
  hideError: _errorsShowing.hideError,
  screenreaderNotification: _alerts.screenreaderNotification
};

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