🐛 fix: Resolve 'Icon is Not a Function' Error in PresetItems (#5260)

* refactor: improve typing

* fix: "TypeError: Icon is not a function" with proper use of Functional Component and Improved Typing
This commit is contained in:
Danny Avila 2025-01-10 19:00:44 -05:00 committed by GitHub
parent 0855677a36
commit 24beda3d69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 57 additions and 49 deletions

View file

@ -91,7 +91,14 @@ export type IconMapProps = {
size?: number;
};
export type AgentIconMapProps = IconMapProps & { agentName: string };
export type IconComponent = React.ComponentType<IconMapProps>;
export type AgentIconComponent = React.ComponentType<AgentIconMapProps>;
export type IconComponentTypes = IconComponent | AgentIconComponent;
export type IconsRecord = {
[key in t.EModelEndpoint | 'unknown' | string]: IconComponentTypes | null | undefined;
};
export type AgentIconMapProps = IconMapProps & { agentName?: string };
export type NavLink = {
title: string;