import classNames from 'classnames';
import React from 'react';
import styles from './style.less';

type ComponentType<Props> = React.ComponentClass<Props, any> | React.FunctionComponent<Props>;

type IconProps<Props> = {
  className?: string;
  style?: React.CSSProperties;
  icon: ComponentType<Props>;
  onClick?: () => void;
  title?: string;
};
const IconWrapper = (props: IconProps<any>) => {
  const { className, style, icon: Icon, onClick, title } = props;
  return <Icon className={classNames(className, styles.flex)} style={style} onClick={onClick} title={title} />;
};
export default IconWrapper;
