import { createVNode as _createVNode } from "vue";
import { arrayType, funcType, stringType } from "@antdv/pro-utils";
import { defineComponent } from "vue";
import { defaultRenderLogo } from "./index.mjs";
const defaultContentProps = {
  appList: arrayType(),
  itemClick: funcType(),
  baseClassName: stringType(),
  hashId: stringType()
};
const DefaultContent = defineComponent({
  name: "DefaultContent",
  props: defaultContentProps,
  setup(props) {
    return () => {
      const {
        appList,
        baseClassName,
        hashId,
        itemClick
      } = props;
      return _createVNode("div", {
        "class": `${baseClassName}-content ${hashId}`.trim()
      }, [_createVNode("ul", {
        "class": `${baseClassName}-content-list ${hashId}`.trim()
      }, [appList == null ? void 0 : appList.map((app, index) => {
        var _a;
        if ((_a = app == null ? void 0 : app.children) == null ? void 0 : _a.length) {
          return _createVNode("div", {
            "key": index,
            "class": `${baseClassName}-content-list-item-group ${hashId}`.trim()
          }, [_createVNode("div", {
            "class": `${baseClassName}-content-list-item-group-title ${hashId}`.trim()
          }, [app.title]), _createVNode(DefaultContent, {
            "hashId": hashId,
            "itemClick": itemClick,
            "appList": app == null ? void 0 : app.children,
            "baseClassName": baseClassName
          }, null)]);
        }
        return _createVNode("li", {
          "key": index,
          "class": `${baseClassName}-content-list-item ${hashId}`.trim(),
          "onClick": (e) => {
            e.stopPropagation();
            itemClick == null ? void 0 : itemClick(app);
          }
        }, [_createVNode("a", {
          "href": itemClick ? void 0 : app.url,
          "target": app.target,
          "rel": "noreferrer"
        }, [defaultRenderLogo(app.icon), _createVNode("div", null, [_createVNode("div", null, [app.title]), app.desc ? _createVNode("span", null, [app.desc]) : null])])]);
      })])]);
    };
  }
});
export {
  DefaultContent,
  defaultContentProps
};
