import React, { useContext, HtmlHTMLAttributes } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
// import { ConfigContext } from '../config/index';


const Icon: React.FC<IconProps> = (props) => {

  const { className, type } = props;

  // const { getPrefixCls } = useContext(ConfigContext);

  const prefixCls = 'ouio-icon';
  // const prefixCls = getPrefixCls('icon');
  const classes = classNames(
    prefixCls,
    [`${prefixCls}-${type}`],
    className,
  );

  return (
    <i className={classes} />
  );
};

Icon.propTypes = {
  type: PropTypes.string.isRequired,
};


interface IconProps extends React.HtmlHTMLAttributes<HTMLElement> {
  type: string;
}


export default Icon;
