import React__default, { useRef, useContext } from "react";
import cs from "../_util/classNames.js";
import omit from "../_util/omit.js";
import { ConfigContext } from "../ConfigProvider/index.js";
import { jsx } from "../../../../../../@emotion_react@11.10.4_3toe27fv7etiytxb5kxc7fxaw4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
var __assign = globalThis && globalThis.__assign || function() {
  __assign = Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p))
          t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
var __rest = globalThis && globalThis.__rest || function(s, e) {
  var t = {};
  for (var p in s)
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
      t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
    for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
      if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
        t[p[i]] = s[p[i]];
    }
  return t;
};
function TabPane(props, ref) {
  var shouldRender = useRef(false);
  var getPrefixCls = useContext(ConfigContext).getPrefixCls;
  var children = props.children, className = props.className, style = props.style, lazyload = props.lazyload, isActive = props.isActive, rest = __rest(props, ["children", "className", "style", "lazyload", "isActive"]);
  var prefixCls = getPrefixCls("tabs");
  shouldRender.current = lazyload ? shouldRender.current || isActive : true;
  return shouldRender.current && /* @__PURE__ */ jsx("div", {
    ...__assign({
      ref
    }, omit(rest, ["destroyOnHide", "title", "closable"]), {
      className: cs(prefixCls + "-pane", className),
      style
    }),
    children
  });
}
var TabPaneRef = React__default.forwardRef(TabPane);
TabPaneRef.displayName = "TabPane";
TabPaneRef.isTabPane = true;
const TabPane$1 = TabPaneRef;
export {
  TabPane$1 as default
};
//# sourceMappingURL=tab-pane.js.map
