erp-platform/ui/src/configs/navigation-icon.config.tsx
2025-10-12 21:45:03 +03:00

24 lines
603 B
TypeScript

import * as fc from 'react-icons/fc'
import * as fa from 'react-icons/fa'
import type { ComponentType } from 'react'
export type NavigationIcons = Record<string, ComponentType<any>>
const navigationIcon: NavigationIcons = {}
function registerIcons(iconModule: Record<string, any>) {
for (const [key, Icon] of Object.entries(iconModule)) {
if (
Icon &&
(typeof Icon === 'function' ||
(typeof Icon === 'object' && 'render' in Icon))
) {
navigationIcon[key] = Icon as ComponentType<any>
}
}
}
registerIcons(fc)
registerIcons(fa)
export default navigationIcon