'use strict';

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

var _stateHelper = require('../../../../common/util/stateHelper');

var _stateHelper2 = _interopRequireDefault(_stateHelper);

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

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

var _presenter2 = _interopRequireDefault(_presenter);

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

function mapStateToProps(state, ownProps) {
  var quizSessionIds = ownProps.rowData.quizSessionIds;

  var quizSessions = _stateHelper2.default.findQuizSessions(quizSessionIds).filter(function (qs) {
    return qs.isLoaded() && !qs.pending();
  });

  return { quizSessions: quizSessions };
}

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