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

function IconCloseCircleComponent(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-close-circle${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 48 48" {...rest} ref={ref}><path d="M40 24c0-8.836-7.163-16-16-16-8.836 0-16 7.164-16 16 0 8.837 7.164 16 16 16 8.837 0 16-7.163 16-16Zm-8.215-4.943-4.95 4.95 4.95 4.95-2.828 2.828-4.95-4.95-4.95 4.95-2.828-2.828 4.95-4.95-4.95-4.95 2.828-2.828 4.95 4.95 4.95-4.95 2.828 2.828ZM44 24c0 11.046-8.954 20-20 20S4 35.046 4 24 12.954 4 24 4s20 8.954 20 20Z"/></svg>;
}

const IconCloseCircle = React.forwardRef(IconCloseCircleComponent);
export default IconCloseCircle;
