import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import PropTypes from 'prop-types';
import { CommonList } from './common/CommonList';
export var PureList =
/*#__PURE__*/
function (_CommonList) {
  _inheritsLoose(PureList, _CommonList);

  function PureList(props) {
    var _this;

    _this = _CommonList.call(this, props) || this;
    _this.renderItem = _this.renderItem.bind(_assertThisInitialized(_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;
}(CommonList);

_defineProperty(PureList, "propTypes", Object.assign({}, CommonList.propTypes, {
  rows: PropTypes.array.isRequired
}));