You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
710 B

import * as React from 'react';
import classNames from 'classnames';
import omit from 'omit.js';
import { library, antDesignIcons } from 'antd-icons';
import AntdIcon from 'react-antd-icons';
6 years ago
library.add(...antDesignIcons);
export interface IconProps {
type: string;
className?: string;
title?: string;
8 years ago
onClick?: React.MouseEventHandler<any>;
spin?: boolean;
style?: React.CSSProperties;
}
8 years ago
const Icon = (props: IconProps) => {
const { type, className = '', spin } = props;
const classString = classNames({
anticon: true,
'anticon-spin': !!spin || type === 'loading',
}, className);
6 years ago
return <AntdIcon {...omit(props, ['spin'])} className={classString} />;
8 years ago
};
8 years ago
export default Icon;