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

function IconUploadingErrorComponent(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-uploading-error${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 16 17" {...rest} ref={ref}><path fillRule="evenodd" d="M8.504 9.9c.453 0 .721-.373.776-.75.209-1.437.279-4.343.279-5.765a.778.778 0 0 0-.778-.777H7.219a.778.778 0 0 0-.778.777c0 1.422.067 4.328.276 5.766.055.376.324.749.776.749h1.011ZM7.5 11.198a.9.9 0 0 0-.9.9v1a.9.9 0 0 0 .9.9h1a.9.9 0 0 0 .9-.9v-1a.9.9 0 0 0-.9-.9h-1Z" clipRule="evenodd"/></svg>;
}

const IconUploadingError = React.forwardRef(IconUploadingErrorComponent);
export default IconUploadingError;
