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.
|
|
|
import * as React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import omit from 'omit.js';
|
|
|
|
|
|
|
|
export interface IconProps {
|
|
|
|
type: string;
|
|
|
|
className?: string;
|
|
|
|
title?: string;
|
|
|
|
onClick?: React.MouseEventHandler<any>;
|
|
|
|
spin?: boolean;
|
|
|
|
style?: React.CSSProperties;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default (props: IconProps) => {
|
|
|
|
const { type, className = '', spin } = props;
|
|
|
|
const classString = classNames({
|
|
|
|
anticon: true,
|
|
|
|
'anticon-spin': !!spin || type === 'loading',
|
|
|
|
[`anticon-${type}`]: true,
|
|
|
|
[className]: true,
|
|
|
|
});
|
|
|
|
return <i {...omit(props, ['type', 'spin'])} className={classString} />;
|
|
|
|
};
|