diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx index eca7fb30d8..136ddb27ee 100644 --- a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx +++ b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx @@ -15,6 +15,7 @@ import { useStrategyProviders } from '@/service/use-strategy' import type { StrategyPluginDetail } from '@/app/components/plugins/types' import type { ToolWithProvider } from '../../../types' import { CollectionType } from '@/app/components/tools/types' +import useGetIcon from '@/app/components/plugins/install-plugin/base/use-get-icon' const ExternalNotInstallWarn = () => { const { t } = useTranslation() @@ -82,15 +83,19 @@ export const AgentStrategySelector = (props: AgentStrategySelectorProps) => { }, [query, list]) // TODO: should be replaced by real data const isExternalInstalled = true + const { getIconUrl } = useGetIcon() + // TODO: 验证这玩意写对了没 + const iconFilename = list?.find( + coll => coll.tools?.find(tool => tool.name === value?.agent_strategy_name), + )?.icon + const icon = iconFilename ? getIconUrl(iconFilename as string) : undefined const { t } = useTranslation() return
setOpen(o => !o)}> {/* eslint-disable-next-line @next/next/no-img-element */} - {list && value && coll.tools?.find(tool => tool.name === value.agent_strategy_name), - )?.icon as string} + {icon &&