fix: build

This commit is contained in:
Ida Dittrich 2026-01-26 10:55:16 +01:00
parent b142b93666
commit 1cb9503c93
2 changed files with 10 additions and 6 deletions

View file

@ -134,9 +134,14 @@ const SidebarItem: React.FC<SidebarItemProps> = 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<SidebarItemProps> = 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

View file

@ -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<React.SVGProps<SVGSVGElement>>; // Allow both IconType and SVG components
submenu?: SidebarSubmenuItemData[]; // Recursive support for nested submenus
depth?: number; // Hierarchy depth for indentation (0 = top level)
}