mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### 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)
17 lines
395 B
TypeScript
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;
|