From 9194335dd741e1254b84b2d68718cc97a958f27c Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Thu, 18 Dec 2025 19:47:58 -0800 Subject: [PATCH] fix: TypeScript type error in HierarchyBreadcrumb filter --- frontend/src/components/facility3d/HierarchyBreadcrumb.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/facility3d/HierarchyBreadcrumb.tsx b/frontend/src/components/facility3d/HierarchyBreadcrumb.tsx index 1fe3e16..18a4560 100644 --- a/frontend/src/components/facility3d/HierarchyBreadcrumb.tsx +++ b/frontend/src/components/facility3d/HierarchyBreadcrumb.tsx @@ -25,14 +25,15 @@ const levelIcons: Record = { }; export function HierarchyBreadcrumb({ data, onNavigate }: HierarchyBreadcrumbProps) { - const levels: { key: keyof BreadcrumbData; label: string }[] = [ + const allLevels: { key: keyof BreadcrumbData; label: string }[] = [ { key: 'facility', label: data.facility || '' }, { key: 'building', label: data.building || '' }, { key: 'floor', label: data.floor || '' }, { key: 'room', label: data.room || '' }, { key: 'section', label: data.section || '' }, { key: 'tier', label: data.tier ? `Tier ${data.tier}` : '' }, - ].filter(l => l.label); + ]; + const levels = allLevels.filter((l): l is { key: keyof BreadcrumbData; label: string } => !!l.label); if (levels.length === 0) return null;