"use strict";

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

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

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

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

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

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

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

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

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

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

var _react = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _excluded = ["hiddenClassName", "hidden", "className"];

var LazyRenderBox = /*#__PURE__*/function (_Component) {
  (0, _inherits2["default"])(LazyRenderBox, _Component);

  var _super = (0, _createSuper2["default"])(LazyRenderBox);

  function LazyRenderBox() {
    (0, _classCallCheck2["default"])(this, LazyRenderBox);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(LazyRenderBox, [{
    key: "shouldComponentUpdate",
    value: function shouldComponentUpdate(nextProps) {
      return !!nextProps.hiddenClassName || !nextProps.hidden;
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          hiddenClassName = _this$props.hiddenClassName,
          hidden = _this$props.hidden,
          className = _this$props.className,
          otherProps = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
      var classString = (0, _classnames["default"])(className, (0, _defineProperty2["default"])({}, hiddenClassName, hiddenClassName && hidden));
      return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
        className: classString
      }, otherProps));
    }
  }]);
  return LazyRenderBox;
}(_react.Component);

exports["default"] = LazyRenderBox;
//# sourceMappingURL=LazyRenderBox.js.map
