diff --git a/src/renderer/src/config/agent.ts b/src/renderer/src/config/agent.ts index ec0b4a11da..af5435d718 100644 --- a/src/renderer/src/config/agent.ts +++ b/src/renderer/src/config/agent.ts @@ -1,5 +1,5 @@ import ClaudeAvatar from '@renderer/assets/images/models/claude.png' -import { AgentBase, AgentEntity } from '@renderer/types' +import { AgentBase, AgentType } from '@renderer/types' // base agent config. no default config for now. const DEFAULT_AGENT_CONFIG: Omit = { @@ -11,7 +11,7 @@ export const DEFAULT_CLAUDE_CODE_CONFIG: Omit = { ...DEFAULT_AGENT_CONFIG } as const -export const getAgentAvatar = (type: AgentEntity['type']): string => { +export const getAgentAvatar = (type: AgentType): string => { switch (type) { case 'claude-code': return ClaudeAvatar diff --git a/src/renderer/src/i18n/label.ts b/src/renderer/src/i18n/label.ts index db29d3f5e1..c0cc436de8 100644 --- a/src/renderer/src/i18n/label.ts +++ b/src/renderer/src/i18n/label.ts @@ -346,10 +346,11 @@ export const getBuiltinOcrProviderLabel = (key: BuiltinOcrProviderId) => { else return getLabel(builtinOcrProviderKeyMap, key) } -const agentTypeKeyMap = { - 'claude-code': 'Claude Code' -} as const satisfies Record - export const getAgentTypeLabel = (key: AgentType) => { - return getLabel(agentTypeKeyMap, key, t('agent.type.unknown')) + switch (key) { + case 'claude-code': + return 'Claude Code' + default: + return 'Unknown Type' + } } diff --git a/src/renderer/src/pages/settings/AgentSettings/index.tsx b/src/renderer/src/pages/settings/AgentSettings/index.tsx index 05413115a7..0de7c1996b 100644 --- a/src/renderer/src/pages/settings/AgentSettings/index.tsx +++ b/src/renderer/src/pages/settings/AgentSettings/index.tsx @@ -53,8 +53,8 @@ const AgentSettingPopupContainer: React.FC = ({ tab, ag key: 'prompt', label: t('agent.settings.prompt') } - ] satisfies { key: AgentSettingPopupTab; label: string }[] - ).filter(Boolean) as { key: string; label: string }[] + ] as const satisfies { key: AgentSettingPopupTab; label: string }[] + ).filter(Boolean) const ModalContent = () => { if (!agent) {