Feat: Display operator icons on the agent form #3221 (#9138)

### What problem does this PR solve?

Feat: Display operator icons on the agent form #3221
Fix: Fixed the issue where the form corresponding to the tool operator
icon could not appear after clicking it #3211

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-07-31 18:53:03 +08:00
committed by GitHub
parent 26042343d8
commit 89c2067a16
4 changed files with 21 additions and 20 deletions

View File

@ -5,6 +5,7 @@ import { MouseEventHandler, memo, useCallback } from 'react';
import { NodeHandleId, Operator } from '../../constant';
import { ToolCard } from '../../form/agent-form/agent-tools';
import { useFindMcpById } from '../../hooks/use-find-mcp-by-id';
import OperatorIcon from '../../operator-icon';
import useGraphStore from '../../store';
import { NodeWrapper } from './node-wrapper';
@ -57,7 +58,10 @@ function InnerToolNode({
className="cursor-pointer"
data-tool={x.component_name}
>
{x.component_name}
<div className="flex gap-1 items-center pointer-events-none">
<OperatorIcon name={x.component_name as Operator}></OperatorIcon>
{x.component_name}
</div>
</ToolCard>
))}