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

function IconLocalUploadComponent(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-local-upload${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 16 16" {...rest} ref={ref}><path fillRule="evenodd" d="M13.84 11.85a.39.39 0 0 1 .373.281l.436 1.5a.438.438 0 0 1-.42.56H1.77a.438.438 0 0 1-.42-.56l.436-1.5a.39.39 0 0 1 .374-.28h11.678ZM12.573 1.81c.86 0 1.557.697 1.557 1.557v7.315a.39.39 0 0 1-.39.389H2.259a.39.39 0 0 1-.39-.39V3.368c0-.86.698-1.557 1.558-1.557h9.148ZM8.161 4.442c-.792 0-1.473.464-1.773 1.129l-.055.135-.108-.004c-.713 0-1.29.564-1.29 1.26 0 .655.511 1.193 1.166 1.254l.124.006h3.743V8.22l.06-.002a1.114 1.114 0 0 0 1.037-1.099 1.11 1.11 0 0 0-.993-1.094c-.15-.898-.949-1.583-1.91-1.583Z" clipRule="evenodd"/></svg>;
}

const IconLocalUpload = React.forwardRef(IconLocalUploadComponent);
export default IconLocalUpload;
