"use strict";

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

exports.__esModule = true;
exports.PureList = void 0;

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

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _CommonList2 = require("./common/CommonList");

var PureList =
/*#__PURE__*/
function (_CommonList) {
  (0, _inheritsLoose2.default)(PureList, _CommonList);

  function PureList(props) {
    var _this;

    _this = _CommonList.call(this, props) || this;
    _this.renderItem = _this.renderItem.bind((0, _assertThisInitialized2.default)(_this));
    return _this;
  }

  var _proto = PureList.prototype;

  _proto.hasItems = function hasItems() {
    return this.props.rows.length > 0;
  };

  _proto.isEmptyList = function isEmptyList() {
    return this.props.rows.length === 0;
  };

  _proto.isEmptyListMessageVisible = function isEmptyListMessageVisible() {
    return !this.hasItems();
  };

  _proto.renderItems = function renderItems() {
    return this.props.rows.map(this.renderItem);
  };

  return PureList;
}(_CommonList2.CommonList);

exports.PureList = PureList;
(0, _defineProperty2.default)(PureList, "propTypes", Object.assign({}, _CommonList2.CommonList.propTypes, {
  rows: _propTypes.default.array.isRequired
}));