diff --git a/api/src/modules/docs/header-builder.service.ts b/api/src/modules/docs/header-builder.service.ts index f5a1e8ac..30bcc970 100644 --- a/api/src/modules/docs/header-builder.service.ts +++ b/api/src/modules/docs/header-builder.service.ts @@ -50,6 +50,7 @@ const ANT_ICON_TO_MATERIAL: Record = { HomeOutlined: 'home', SendOutlined: 'send', EnvironmentOutlined: 'place', + ScheduleOutlined: 'schedule', CalendarOutlined: 'event', PlayCircleOutlined: 'play_circle', HeartOutlined: 'favorite_border', @@ -60,6 +61,18 @@ const ANT_ICON_TO_MATERIAL: Record = { BookOutlined: 'menu_book', }; +/** + * Convert an Ant Design icon name to a Material Icons ligature name. + * Uses the explicit mapping first, then falls back to stripping the + * Outlined/Filled/TwoTone suffix and converting PascalCase to snake_case. + */ +function toMaterialIcon(antIcon: string): string { + if (ANT_ICON_TO_MATERIAL[antIcon]) return ANT_ICON_TO_MATERIAL[antIcon]; + // Fallback: strip suffix, convert PascalCase → snake_case + const base = antIcon.replace(/(Outlined|Filled|TwoTone)$/, ''); + return base.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); +} + interface NavConfigItem { id: string; label: string; @@ -415,7 +428,7 @@ class HeaderBuilderService { id: item.id, label: item.label, path: resolvedPath, - icon: ANT_ICON_TO_MATERIAL[item.icon] || item.icon, + icon: toMaterialIcon(item.icon), enabled: true, order: item.order, type: item.type, diff --git a/mkdocs/docs/overrides/main.html b/mkdocs/docs/overrides/main.html index 914f93fd..9a9ed57b 100644 --- a/mkdocs/docs/overrides/main.html +++ b/mkdocs/docs/overrides/main.html @@ -13,11 +13,9 @@