@ant-design/pro-layout
Version:
52 lines • 2.31 kB
JavaScript
import React from 'react';
import { defaultRenderLogo } from "./index";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export var DefaultContent = function DefaultContent(props) {
var appList = props.appList,
baseClassName = props.baseClassName,
hashId = props.hashId,
itemClick = props.itemClick;
return /*#__PURE__*/_jsx("div", {
className: "".concat(baseClassName, "-content ").concat(hashId).trim(),
children: /*#__PURE__*/_jsx("ul", {
className: "".concat(baseClassName, "-content-list ").concat(hashId).trim(),
children: appList === null || appList === void 0 ? void 0 : appList.map(function (app, index) {
var _app$children;
if (app !== null && app !== void 0 && (_app$children = app.children) !== null && _app$children !== void 0 && _app$children.length) {
return /*#__PURE__*/_jsxs("div", {
className: "".concat(baseClassName, "-content-list-item-group ").concat(hashId).trim(),
children: [/*#__PURE__*/_jsx("div", {
className: "".concat(baseClassName, "-content-list-item-group-title ").concat(hashId).trim(),
children: app.title
}), /*#__PURE__*/_jsx(DefaultContent, {
hashId: hashId,
itemClick: itemClick,
appList: app === null || app === void 0 ? void 0 : app.children,
baseClassName: baseClassName
})]
}, index);
}
return /*#__PURE__*/_jsx("li", {
className: "".concat(baseClassName, "-content-list-item ").concat(hashId).trim(),
onClick: function onClick(e) {
e.stopPropagation();
itemClick === null || itemClick === void 0 || itemClick(app);
},
children: /*#__PURE__*/_jsxs("a", {
href: itemClick ? undefined : app.url,
target: app.target,
rel: "noreferrer",
children: [defaultRenderLogo(app.icon), /*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx("div", {
children: app.title
}), app.desc ? /*#__PURE__*/_jsx("span", {
children: app.desc
}) : null]
})]
})
}, index);
})
})
});
};