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

function IconUploadComponent(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-upload${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 12 12" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M2.8125 7.87524C2.98509 7.87524 3.125 8.01516 3.125 8.18775V9.12525H8.875V8.18775C8.875 8.01516 9.01491 7.87524 9.1875 7.87524H9.8125C9.98509 7.87524 10.125 8.01516 10.125 8.18775V9.75024C10.125 10.0954 9.84518 10.3752 9.5 10.3752H2.5C2.15482 10.3752 1.875 10.0954 1.875 9.75024V8.18775C1.875 8.01516 2.01491 7.87524 2.1875 7.87524H2.8125ZM6.29683 1.71677L8.64043 4.06037C8.76247 4.1824 8.76247 4.38027 8.64043 4.50231L8.19848 4.94425C8.07645 5.06629 7.87858 5.06629 7.75654 4.94425L6.62494 3.81272L6.625 6.96003C6.625 7.13262 6.48509 7.27253 6.3125 7.27253H5.6875C5.51491 7.27253 5.375 7.13262 5.375 6.96003L5.37468 3.96431L4.39518 4.94425C4.27314 5.06629 4.07528 5.06629 3.95324 4.94425L3.5113 4.50231C3.38926 4.38027 3.38926 4.1824 3.5113 4.06037L5.85489 1.71677C5.97693 1.59473 6.1748 1.59473 6.29683 1.71677Z"/></svg>;
}

const IconUpload = React.forwardRef(IconUploadComponent);
export default IconUpload;
