import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React, { memo, useRef } from 'react';
import classnames from 'classnames';

var PanelContent = function PanelContent(props) {
  var _classnames;

  var prefixCls = props.prefixCls,
      isInactive = props.isInactive,
      children = props.children,
      destroyInactivePanel = props.destroyInactivePanel,
      forceRender = props.forceRender,
      role = props.role;
  var isActived = useRef();
  isActived.current = forceRender || isActived.current || !isInactive;

  if (!isActived.current) {
    return null;
  }

  var contentCls = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-content"), true), _defineProperty(_classnames, "".concat(prefixCls, "-content-active"), !isInactive), _defineProperty(_classnames, "".concat(prefixCls, "-content-inactive"), isInactive), _classnames));
  var child = !forceRender && isInactive && destroyInactivePanel ? null : /*#__PURE__*/React.createElement("div", {
    className: "".concat(prefixCls, "-content-box")
  }, children);
  return /*#__PURE__*/React.createElement("div", {
    className: contentCls,
    role: role
  }, child);
};

PanelContent.displayName = 'RcPanelContent';
export default /*#__PURE__*/memo(PanelContent, function (props, nextProps) {
  return !props.forceRender && props.isInactive && nextProps.isInactive;
});
//# sourceMappingURL=PanelContent.js.map
