fix: Bibliothek section always visible in left sidebar

- LeftSidebar was hiding entire Bibliothek section when blocks array was empty
- Removed blocks.length > 0 conditional wrapper
- Added blocks || [] fallback to prevent crash
- Library tree now visible even with no blocks
This commit is contained in:
2026-06-29 13:13:43 +02:00
parent ba978cd13c
commit 2c6f7b2e8b
+1 -3
View File
@@ -121,11 +121,10 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ activeTool, onToolChange, sel
</div> </div>
)} )}
{blocks && blocks.length > 0 && (
<div className="tool-section" key="library"> <div className="tool-section" key="library">
<div className="tool-section-label">Bibliothek</div> <div className="tool-section-label">Bibliothek</div>
<BlockLibrary <BlockLibrary
blocks={blocks} blocks={blocks || []}
category="Alle" category="Alle"
onCategoryChange={onBlockCategoryChange ?? (() => {})} onCategoryChange={onBlockCategoryChange ?? (() => {})}
onSearch={onBlockSearch ?? (() => {})} onSearch={onBlockSearch ?? (() => {})}
@@ -137,7 +136,6 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ activeTool, onToolChange, sel
onSaveGroupAsBlock={onSaveGroupAsBlock} onSaveGroupAsBlock={onSaveGroupAsBlock}
/> />
</div> </div>
)}
<div className="leftbar-footer"> <div className="leftbar-footer">
{onToggleCollapse && ( {onToggleCollapse && (