fix: TypeScript type error in HierarchyBreadcrumb filter
This commit is contained in:
parent
eaa32c05fe
commit
9194335dd7
1 changed files with 3 additions and 2 deletions
|
|
@ -25,14 +25,15 @@ const levelIcons: Record<string, React.ReactNode> = {
|
|||
};
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue