1 | import React from 'react';
|
2 | import { defaultRenderLogo } from "./index";
|
3 | import { jsx as _jsx } from "react/jsx-runtime";
|
4 | import { jsxs as _jsxs } from "react/jsx-runtime";
|
5 | export var DefaultContent = function DefaultContent(props) {
|
6 | var appList = props.appList,
|
7 | baseClassName = props.baseClassName,
|
8 | hashId = props.hashId,
|
9 | itemClick = props.itemClick;
|
10 | return _jsx("div", {
|
11 | className: "".concat(baseClassName, "-content ").concat(hashId),
|
12 | children: _jsx("ul", {
|
13 | className: "".concat(baseClassName, "-content-list ").concat(hashId),
|
14 | children: appList === null || appList === void 0 ? void 0 : appList.map(function (app, index) {
|
15 | var _app$children;
|
16 | if (app !== null && app !== void 0 && (_app$children = app.children) !== null && _app$children !== void 0 && _app$children.length) {
|
17 | return _jsxs("div", {
|
18 | className: "".concat(baseClassName, "-content-list-item-group ").concat(hashId).trim(),
|
19 | children: [_jsx("div", {
|
20 | className: "".concat(baseClassName, "-content-list-item-group-title ").concat(hashId).trim(),
|
21 | children: app.title
|
22 | }), _jsx(DefaultContent, {
|
23 | hashId: hashId,
|
24 | itemClick: itemClick,
|
25 | appList: app === null || app === void 0 ? void 0 : app.children,
|
26 | baseClassName: baseClassName
|
27 | })]
|
28 | }, index);
|
29 | }
|
30 | return _jsx("li", {
|
31 | className: "".concat(baseClassName, "-content-list-item ").concat(hashId).trim(),
|
32 | children: _jsxs("a", {
|
33 | href: itemClick ? undefined : app.url,
|
34 | onClick: function onClick() {
|
35 | return itemClick === null || itemClick === void 0 ? void 0 : itemClick(app);
|
36 | },
|
37 | target: app.target,
|
38 | rel: "noreferrer",
|
39 | children: [defaultRenderLogo(app.icon), _jsxs("div", {
|
40 | children: [_jsx("div", {
|
41 | children: app.title
|
42 | }), app.desc ? _jsx("span", {
|
43 | children: app.desc
|
44 | }) : null]
|
45 | })]
|
46 | })
|
47 | }, index);
|
48 | })
|
49 | })
|
50 | });
|
51 | }; |
\ | No newline at end of file |