refactor(types): eliminate any types in DynamicField icon lookup

This commit is contained in:
DrSmoothl
2026-03-01 17:05:16 +08:00
parent 5f211f2bcc
commit 7e93d886a2

View File

@@ -35,7 +35,7 @@ export const DynamicField: React.FC<DynamicFieldProps> = ({
const renderIcon = () => {
if (!schema['x-icon']) return null
const IconComponent = (LucideIcons as any)[schema['x-icon']]
const IconComponent = LucideIcons[schema['x-icon'] as keyof typeof LucideIcons] as React.ComponentType<{ className?: string }> | undefined
if (!IconComponent) return null
return <IconComponent className="h-4 w-4" />