Update lazy.ts

This commit is contained in:
alorig
2025-11-09 22:32:29 +05:00
parent 1d7cbeffb6
commit 1f8f50d019

View File

@@ -9,7 +9,7 @@
* const PlusIcon = lazyIcon('plus');
*/
import { lazy, ComponentType } from 'react';
import React, { lazy, ComponentType } from 'react';
// Icon name to component mapping
const iconMap: Record<string, () => Promise<{ default: ComponentType<any> }>> = {
@@ -81,7 +81,7 @@ export function lazyIcon(iconName: string): ComponentType<any> {
if (!loader) {
console.warn(`Icon "${iconName}" not found. Available icons: ${Object.keys(iconMap).join(', ')}`);
// Return a placeholder component
return () => <span>?</span>;
return () => React.createElement('span', null, '?');
}
return lazy(loader);
}