import React, { memo } from 'react'; import * as Icon from '@ant-design/icons'; import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon'; import { AntdIconType } from './icon'; import { IIconConfig } from './schema'; import logo from '@/assets/icon_01.png'; interface IconType extends IIconConfig { isTpl?: boolean; } const XIcon = memo((props: IconType) => { const { color, size, link, text, fontSize, fontColor, type, spin, isTpl } = props; const MyIcon: React.ForwardRefExoticComponent & React.RefAttributes> = Icon[type]; const handleClick = () => { if (!link || window.location.href.indexOf('/editor') > -1) return; window.location.href = link; }; return isTpl ? (
) : (
{text}
); }); export default XIcon;