import React from "react" ; import classNames from "classnames" ; import { createFromIconfontCN } from "@ant-design/icons" ; import styles from "./Icon.module.less" ; export interface IconType extends React . HTMLAttributes < any > { type : string ; size ? : "small" | "normal" | "large" | null ; disabled ? : boolean ; } const FontIcon = createFromIconfontCN ( { scriptUrl : "//at.alicdn.com/t/font_2742219_5q5w02ov9d4.js" , } ) ; const Icon = ( { className , size = "normal" , disabled , ... restProps } ) => { return ( < FontIcon className = { classNames ( { [ styles . large ] : size === "large" , [ styles . normal ] : size === "normal" , [ styles . small ] : size === "small" , [ styles . disabled ] : disabled , } , className ) } { ... restProps } />); } ; export default React . memo ( Icon ) ;