"use strict";

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

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

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

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

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

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

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

  return {
    quizSessions: quizSessions
  };
}

var _default = (0, _reactRedux.connect)(mapStateToProps)(_presenter.default);

exports.default = _default;