diff --git a/web/src/components/GroupPanelItem.tsx b/web/src/components/GroupPanelItem.tsx index 786d89bb..afeaab9d 100644 --- a/web/src/components/GroupPanelItem.tsx +++ b/web/src/components/GroupPanelItem.tsx @@ -15,7 +15,7 @@ export const GroupPanelItem: React.FC<{ const isActive = location.pathname.startsWith(to); return ( - +
{props.header}
{ const { groupId } = useParams(); @@ -21,24 +21,33 @@ export const Sidebar: React.FC = React.memo(() => {
-
+
{groupPanels - .filter((panel) => panel.type === GroupPanelType.GROUP) - .map((group) => ( - - {groupPanels - .filter((panel) => panel.parentId === group.id) - .map((panel) => ( -
- #
} - to={`/main/group/${groupId}/${panel.id}`} - /> -
- ))} - - ))} + .filter((panel) => !isValidStr(panel.parentId)) + .map((panel) => + panel.type === GroupPanelType.GROUP ? ( + + {groupPanels + .filter((sub) => sub.parentId === panel.id) + .map((sub) => ( +
+ #
} + to={`/main/group/${groupId}/${sub.id}`} + /> +
+ ))} + + ) : ( + #
} + to={`/main/group/${groupId}/${panel.id}`} + /> + ) + )}
);