mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Display the pipeline on the agent canvas #9869 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
20 lines
613 B
TypeScript
20 lines
613 B
TypeScript
import { buildNodeOutputOptions } from '@/utils/canvas-util';
|
|
import { useMemo } from 'react';
|
|
import { Operator } from '../constant';
|
|
import OperatorIcon from '../operator-icon';
|
|
import useGraphStore from '../store';
|
|
|
|
export function useBuildNodeOutputOptions(nodeId?: string) {
|
|
const nodes = useGraphStore((state) => state.nodes);
|
|
const edges = useGraphStore((state) => state.edges);
|
|
|
|
return useMemo(() => {
|
|
return buildNodeOutputOptions({
|
|
nodes,
|
|
edges,
|
|
nodeId,
|
|
Icon: ({ name }) => <OperatorIcon name={name as Operator}></OperatorIcon>,
|
|
});
|
|
}, [edges, nodeId, nodes]);
|
|
}
|