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

function IconEnableComponent(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-enable${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="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1Zm0 2a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm4.85 5.977.707.707a.5.5 0 0 1 0 .707l-6.364 6.364a.5.5 0 0 1-.707 0l-3.66-3.66a.5.5 0 0 1 0-.708l.707-.707a.5.5 0 0 1 .707 0l2.6 2.6 5.303-5.303a.5.5 0 0 1 .707 0Z" clipRule="evenodd"/></svg>;
}

const IconEnable = React.forwardRef(IconEnableComponent);
export default IconEnable;
