import React, { ForwardedRef, useContext } from 'react';
import { OriginIconProps } from '../type';
import { Context } from '../context';

function IconInfoComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = true, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-info${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M1 12a11 11 0 1 1 22 0 11 11 0 0 1-22 0Zm11.293-2.487c.395 0 .713.318.713.714l.002 5.277h.789c.394 0 .714.32.714.715v.559a.714.714 0 0 1-.713.715h-3.58a.715.715 0 0 1-.714-.715v-.56c0-.393.319-.714.713-.714h.78v-4.005a.687.687 0 0 1-.689-.687v-.585c0-.394.32-.714.715-.714h1.27ZM12.07 6.5c.395 0 .715.318.715.713v.572c0 .395-.32.715-.715.715h-.634a.715.715 0 0 1-.713-.715v-.572c0-.395.319-.713.713-.713h.634ZM12.002 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z" clipRule="evenodd"/></svg>;
}

const IconInfo = React.forwardRef(IconInfoComponent);
export default IconInfo;
