import { createVNode as _createVNode } from "vue";
import { classNames, stringType } from "@antdv/pro-utils";
import { useConfigContextInject } from "ant-design-vue/lib/config-provider/context";
import { computed, defineComponent } from "vue";
import { RouteContext } from "../../context/RouteContext.mjs";
import { useStyle } from "./style.mjs";
const GridContent = defineComponent({
  name: "GridContent",
  inheritAttrs: false,
  props: {
    contentWidth: stringType(),
    prefixCls: stringType()
  },
  setup(props, {
    attrs,
    slots
  }) {
    const value = RouteContext.useContext();
    const {
      getPrefixCls
    } = useConfigContextInject();
    const prefixCls = computed(() => props.prefixCls || getPrefixCls("pro"));
    const contentWidth = computed(() => props.contentWidth || value.contentWidth);
    const gridClassName = computed(() => `${prefixCls.value}-grid-content`);
    const {
      wrapSSR,
      hashId
    } = useStyle(gridClassName);
    return () => {
      var _a;
      const isWide = contentWidth.value === "Fixed" && value.layout === "top";
      return wrapSSR(_createVNode("div", {
        "class": classNames(gridClassName.value, hashId.value, attrs.class || "", {
          [`${gridClassName.value}-wide`]: isWide
        }),
        "style": attrs.style
      }, [_createVNode("div", {
        "class": `${prefixCls.value}-grid-content-children ${hashId.value}`.trim()
      }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]));
    };
  }
});
export {
  GridContent
};
