fix: TypeScript type error in HierarchyBreadcrumb filter
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

This commit is contained in:
fullsizemalt 2025-12-18 19:47:58 -08:00
parent eaa32c05fe
commit 9194335dd7

View file

@ -25,14 +25,15 @@ const levelIcons: Record<string, React.ReactNode> = {
}; };
export function HierarchyBreadcrumb({ data, onNavigate }: HierarchyBreadcrumbProps) { 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: 'facility', label: data.facility || '' },
{ key: 'building', label: data.building || '' }, { key: 'building', label: data.building || '' },
{ key: 'floor', label: data.floor || '' }, { key: 'floor', label: data.floor || '' },
{ key: 'room', label: data.room || '' }, { key: 'room', label: data.room || '' },
{ key: 'section', label: data.section || '' }, { key: 'section', label: data.section || '' },
{ key: 'tier', label: data.tier ? `Tier ${data.tier}` : '' }, { 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; if (levels.length === 0) return null;