Files
ragflow/web/src/pages/flow/operator-icon/index.tsx
balibabu ff5ea266d2 feat: add icon to graph nodes #918 (#1117)
### What problem does this PR solve?

feat: add icon to graph nodes #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2024-06-11 18:01:19 +08:00

17 lines
395 B
TypeScript

import React from 'react';
import { Operator, operatorIconMap } from '../constant';
import styles from './index.less';
interface IProps {
name: Operator;
fontSize?: number;
}
const OperatorIcon = ({ name, fontSize }: IProps) => {
const Icon = operatorIconMap[name] || React.Fragment;
return <Icon className={styles.icon} style={{ fontSize }}></Icon>;
};
export default OperatorIcon;