"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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

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

var LazyRenderBox = function LazyRenderBox(props) {
  var hiddenClassName = props.hiddenClassName,
      hidden = props.hidden,
      rest = (0, _objectWithoutProperties2["default"])(props, _excluded);

  if (hiddenClassName || _react.Children.count(rest.children) > 1) {
    if (hidden && hiddenClassName) {
      rest.className += " ".concat(hiddenClassName);
    }

    return /*#__PURE__*/_react["default"].createElement("div", rest);
  }

  return _react.Children.only(rest.children);
};

LazyRenderBox.displayName = 'RcLazyRenderBox';

var _default = /*#__PURE__*/(0, _react.memo)(LazyRenderBox, function (props, nextProps) {
  return !nextProps.hiddenClassName && nextProps.hidden;
});

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