Files
ragflow/web/src/pages/agent/canvas/node/tool-node.tsx
balibabu 371f61972d Feat: Add tool nodes and tool drop-down menu #3221 (#8335)
### What problem does this PR solve?

Feat: Add tool nodes and tool drop-down menu #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-06-18 12:36:44 +08:00

35 lines
995 B
TypeScript

import { IToolNode } from '@/interfaces/database/agent';
import { NodeProps, Position } from '@xyflow/react';
import { memo } from 'react';
import { NodeHandleId } from '../../constant';
import { CommonHandle } from './handle';
import { LeftHandleStyle } from './handle-icon';
import NodeHeader from './node-header';
import { NodeWrapper } from './node-wrapper';
import { ToolBar } from './toolbar';
function InnerToolNode({
id,
data,
isConnectable = true,
selected,
}: NodeProps<IToolNode>) {
return (
<ToolBar selected={selected} id={id} label={data.label}>
<NodeWrapper>
<CommonHandle
id={NodeHandleId.End}
type="target"
position={Position.Top}
isConnectable={isConnectable}
style={LeftHandleStyle}
nodeId={id}
></CommonHandle>
<NodeHeader id={id} name={data.name} label={data.label}></NodeHeader>
</NodeWrapper>
</ToolBar>
);
}
export const ToolNode = memo(InnerToolNode);