import { createVNode as _createVNode } from "vue";
import { ProProvider } from "@antdv/pro-provider";
import { anyType, boolType, classNames, ErrorBoundary, numberType, objectType, oneOfType, stringType } from "@antdv/pro-utils";
import { Layout } from "ant-design-vue";
import { defineComponent } from "vue";
const WrapContent = defineComponent({
  name: "WrapContent",
  inheritAttrs: false,
  props: {
    hasPageContainer: numberType(),
    isChildrenLayout: boolType(),
    prefixCls: stringType(),
    style: objectType(),
    location: anyType(),
    contentHeight: oneOfType([Number, String]),
    ErrorBoundary: anyType(),
    hasHeader: boolType()
  },
  setup(props, {
    slots
  }) {
    const {
      hashId
    } = ProProvider.useContext();
    return () => {
      var _a;
      const {
        style,
        prefixCls,
        hasPageContainer = 0
      } = props;
      const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
      const contentClassName = classNames(`${prefixCls}-content`, hashId, {
        [`${prefixCls}-has-header`]: props.hasHeader,
        [`${prefixCls}-content-has-page-container`]: hasPageContainer > 0
      });
      const ErrorComponent = props.ErrorBoundary || ErrorBoundary;
      return props.ErrorBoundary === false ? _createVNode(Layout.Content, {
        "class": contentClassName,
        "style": style
      }, {
        default: () => [children]
      }) : _createVNode(ErrorComponent, null, {
        default: () => [_createVNode(Layout.Content, {
          "class": contentClassName,
          "style": style
        }, {
          default: () => [children]
        })]
      });
    };
  }
});
export {
  WrapContent
};
