2025-02-24 17:19:06 +08:00
|
|
|
import { Operator, operatorIconMap } from './constant';
|
2025-02-24 16:51:44 +08:00
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
name: Operator;
|
|
|
|
fontSize?: number;
|
|
|
|
width?: number;
|
|
|
|
color?: string;
|
|
|
|
}
|
|
|
|
|
2025-03-03 15:44:37 +08:00
|
|
|
const Empty = () => {
|
|
|
|
return <div className="hidden"></div>;
|
|
|
|
};
|
|
|
|
|
2025-02-24 16:51:44 +08:00
|
|
|
const OperatorIcon = ({ name, fontSize, width, color }: IProps) => {
|
2025-03-03 15:44:37 +08:00
|
|
|
const Icon = operatorIconMap[name] || Empty;
|
2025-02-24 16:51:44 +08:00
|
|
|
return (
|
|
|
|
<Icon
|
|
|
|
className={'text-2xl max-h-6 max-w-6 text-[rgb(59, 118, 244)]'}
|
|
|
|
style={{ fontSize, color }}
|
|
|
|
width={width}
|
|
|
|
></Icon>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OperatorIcon;
|