|
@@ -1,5 +1,5 @@
|
|
|
import { FC, useEffect, useRef, useState } from "react";
|
|
|
-import { Button } from "antd";
|
|
|
+import { Button, Empty } from "antd";
|
|
|
import { useNavigate } from "react-router-dom";
|
|
|
import {
|
|
|
DageLoading,
|
|
@@ -41,7 +41,7 @@ export const Sidebar: FC<SidebarProps> = ({
|
|
|
// @ts-ignore
|
|
|
item.hideAddBtn = item.isPoint === YES_OR_NO.YES;
|
|
|
// @ts-ignore
|
|
|
- item.hideDeleteBtn = Boolean(item.children.length);
|
|
|
+ item.hideDeleteBtn = Boolean(item.children?.length);
|
|
|
|
|
|
if (item.children && item.children.length > 0) {
|
|
|
item.children = transformTreeData(item.children);
|
|
@@ -108,7 +108,7 @@ export const Sidebar: FC<SidebarProps> = ({
|
|
|
)}
|
|
|
</div>
|
|
|
|
|
|
- {currentId && treeData.length && (
|
|
|
+ {currentId && treeData.length ? (
|
|
|
<DageTreeActions
|
|
|
defaultExpandAll
|
|
|
maxLevel={isFixed ? 5 : 2}
|
|
@@ -127,6 +127,8 @@ export const Sidebar: FC<SidebarProps> = ({
|
|
|
lastCheckedItem.current = selectedNodes[0];
|
|
|
}}
|
|
|
/>
|
|
|
+ ) : (
|
|
|
+ <Empty />
|
|
|
)}
|
|
|
|
|
|
{loading && <DageLoading />}
|