feat: add DynamicCategorize #918 (#1273)

### What problem does this PR solve?

feat: add DynamicCategorize #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-25 16:17:12 +08:00
committed by GitHub
parent f6ae8fcb71
commit 83b91d90fe
9 changed files with 114 additions and 13 deletions

View File

@ -7,6 +7,7 @@ import { Flex, MenuProps, Space, Typography } from 'antd';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Operator, operatorMap } from '../../constant';
import { NodeData } from '../../interface';
import OperatorIcon from '../../operator-icon';
import useGraphStore from '../../store';
import styles from './index.less';
@ -18,7 +19,7 @@ export function RagNode({
data,
isConnectable = true,
selected,
}: NodeProps<{ label: string }>) {
}: NodeProps<NodeData>) {
const { t } = useTranslation();
const deleteNodeById = useGraphStore((store) => store.deleteNodeById);
const duplicateNodeById = useGraphStore((store) => store.duplicateNode);
@ -78,7 +79,7 @@ export function RagNode({
name={data.label as Operator}
fontSize={12}
></OperatorIcon>
<span>{data.label}</span>
<span>{id}</span>
</Space>
<OperateDropdown
iconFontSize={14}