From 1cb9503c93b923fb797b0a822a502474c1c989cb Mon Sep 17 00:00:00 2001 From: Ida Dittrich Date: Mon, 26 Jan 2026 10:55:16 +0100 Subject: [PATCH] fix: build --- src/components/Sidebar/SidebarItem.tsx | 12 ++++++++---- src/core/PageManager/pageInterface.ts | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/Sidebar/SidebarItem.tsx b/src/components/Sidebar/SidebarItem.tsx index 6526461..b8fd59b 100644 --- a/src/components/Sidebar/SidebarItem.tsx +++ b/src/components/Sidebar/SidebarItem.tsx @@ -134,9 +134,14 @@ const SidebarItem: React.FC = React.memo(({ buttonPosition: buttonComputed?.position, buttonRect: button ? button.getBoundingClientRect() : null, elementsAtIconCenter: elementsAtPoint.slice(0, 5).map(el => { - const className = typeof el.className === 'string' - ? el.className - : (el.className?.baseVal || el.className?.toString() || ''); + let className: string = ''; + if (typeof el.className === 'string') { + className = el.className; + } else if (el.className && typeof el.className === 'object' && 'baseVal' in el.className) { + className = (el.className as { baseVal?: string }).baseVal || ''; + } else if (el.className) { + className = String(el.className); + } return { tag: el.tagName, class: className?.split(' ')[0] || 'no-class', @@ -214,7 +219,6 @@ const SidebarItem: React.FC = React.memo(({ const subIsActive = isSubmenuItemActive(subitem.link); const hasNestedSubmenu = subitem.submenu && subitem.submenu.length > 0; const subIsOpen = nestedOpenStates[subitem.id] || false; - const subDepth = subitem.depth !== undefined ? subitem.depth : (depth === 0 ? 1 : depth + 1); // In minimized mode, items with nested submenus should render as icon buttons // Their submenu will expand below them when clicked diff --git a/src/core/PageManager/pageInterface.ts b/src/core/PageManager/pageInterface.ts index e6c438e..c0a1dc5 100644 --- a/src/core/PageManager/pageInterface.ts +++ b/src/core/PageManager/pageInterface.ts @@ -409,8 +409,8 @@ export interface SidebarItem { export interface SidebarSubmenuItemData { id: string; name: string; - link: string; - icon?: IconType; + link?: string; // Optional - if undefined, it's a navigation node (not a page) + icon?: IconType | React.ComponentType>; // Allow both IconType and SVG components submenu?: SidebarSubmenuItemData[]; // Recursive support for nested submenus depth?: number; // Hierarchy depth for indentation (0 = top level) }