import _extends from "@babel/runtime/helpers/extends";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import PropTypes from 'prop-types';
import { CommonListLayout } from './common/CommonListLayout';
import { PurePagination } from './PurePagination';
import { CounterText } from './CounterText';
export var PureListLayout =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(PureListLayout, _React$Component);

  function PureListLayout() {
    var _this;

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;

    _defineProperty(_assertThisInitialized(_this), "renderCounterText", function () {
      var _this$props = _this.props,
          hasStoreCounterText = _this$props.hasStoreCounterText,
          counter = _this$props.counter,
          storeCounterText = _this$props.storeCounterText;

      if (!hasStoreCounterText) {
        return null;
      }

      return React.createElement(CounterText, {
        counter: counter,
        template: storeCounterText
      });
    });

    _defineProperty(_assertThisInitialized(_this), "renderPagination", function (showPageSizeSelector) {
      if (showPageSizeSelector === void 0) {
        showPageSizeSelector = true;
      }

      var _this$props2 = _this.props,
          paginationProps = _this$props2.paginationProps,
          PaginationComponent = _this$props2.paginationComponent;
      return React.createElement(PaginationComponent, _extends({
        showPageSizeSelector: showPageSizeSelector
      }, paginationProps));
    });

    return _this;
  }

  var _proto = PureListLayout.prototype;

  _proto.render = function render() {
    return React.createElement(CommonListLayout, _extends({
      renderCounterText: this.renderCounterText,
      renderPagination: this.renderPagination
    }, this.props));
  };

  return PureListLayout;
}(React.Component);

_defineProperty(PureListLayout, "propTypes", {
  hasStoreCounterText: PropTypes.bool,
  storeCounterText: PropTypes.string,
  paginationProps: PropTypes.shape(PurePagination.propTypes),
  paginationComponent: PropTypes.func,
  counter: PropTypes.number
});

_defineProperty(PureListLayout, "defaultProps", {
  hasStoreCounterText: true,
  storeCounterText: CounterText.defaultProps.template,
  paginationProps: PurePagination.defaultProps,
  paginationComponent: PurePagination,
  counter: 0
});

_defineProperty(PureListLayout, "VIEW_MODE_DETAILS", CommonListLayout.VIEW_MODE_DETAILS);

_defineProperty(PureListLayout, "VIEW_MODE_FULL", CommonListLayout.VIEW_MODE_FULL);