### 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)
This commit is contained in:
4
web/src/pages/flow/operator-icon/index.less
Normal file
4
web/src/pages/flow/operator-icon/index.less
Normal file
@@ -0,0 +1,4 @@
|
||||
.icon {
|
||||
color: rgb(59, 118, 244);
|
||||
font-size: 24px;
|
||||
}
|
||||
16
web/src/pages/flow/operator-icon/index.tsx
Normal file
16
web/src/pages/flow/operator-icon/index.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user