import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
var _excluded = ["hiddenClassName", "hidden", "className"];
import React, { Component } from 'react';
import classNames from 'classnames';

var LazyRenderBox = /*#__PURE__*/function (_Component) {
  _inherits(LazyRenderBox, _Component);

  var _super = _createSuper(LazyRenderBox);

  function LazyRenderBox() {
    _classCallCheck(this, LazyRenderBox);

    return _super.apply(this, arguments);
  }

  _createClass(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 = _objectWithoutProperties(_this$props, _excluded);

      var classString = classNames(className, _defineProperty({}, hiddenClassName, hiddenClassName && hidden));
      return /*#__PURE__*/React.createElement("div", _extends({
        className: classString
      }, otherProps));
    }
  }]);

  return LazyRenderBox;
}(Component);

export { LazyRenderBox as default };
//# sourceMappingURL=LazyRenderBox.js.map
