MCPcopy Create free account
hub / github.com/esengine/esengine / getIconComponent

Function getIconComponent

packages/editor-app/src/components/FileTree.tsx:20–28  ·  view source on GitHub ↗

* 根据图标名称获取 Lucide 图标组件

(iconName: string | undefined, size: number = 16)

Source from the content-addressed store, hash-verified

18 * 根据图标名称获取 Lucide 图标组件
19 */
20function getIconComponent(iconName: string | undefined, size: number = 16): React.ReactNode {
21 if (!iconName) return <Plus size={size} />;
22 const icons = LucideIcons as unknown as Record<string, React.ComponentType<{ size?: number }>>;
23 const IconComponent = icons[iconName];
24 if (IconComponent) {
25 return <IconComponent size={size} />;
26 }
27 return <Plus size={size} />;
28}
29
30interface TreeNode {
31 name: string;

Callers 1

getContextMenuItemsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected