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;