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

function IconImageUploadComponent(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-image_upload${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 28 28" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M14.6584 4.54338C15.2018 4.54366 15.6427 4.98426 15.6428 5.52775C15.6427 6.07128 15.2019 6.51184 14.6584 6.51212H7.43333C6.16406 6.51238 5.13435 7.54275 5.13435 8.81215L5.1333 20.306C5.13334 20.4682 5.15072 20.6265 5.18273 20.7792L9.36632 16.8354L9.50304 16.7198C10.1518 16.2185 11.0621 16.218 11.7105 16.7198L11.8451 16.8354L14.122 18.983L18.0616 15.2306L18.2005 15.1096C18.9221 14.5495 19.9653 14.6157 20.6109 15.2895L22.8678 17.6442V14.1063C22.8679 13.5628 23.3086 13.1221 23.8522 13.1219C24.3956 13.1222 24.8365 13.5629 24.8366 14.1063V20.306C24.8363 22.6633 22.926 24.5734 20.5688 24.5737H7.43228C5.07529 24.5732 3.16483 22.6632 3.16455 20.306V8.81215C3.16455 6.45456 5.07593 4.54363 7.43333 4.54338H14.6584ZM6.38691 22.3505C6.70072 22.5114 7.05554 22.6048 7.43228 22.605H10.3213L12.6949 20.3428L10.6063 18.373L6.38691 22.3505ZM13.1787 22.605H20.5688C21.7784 22.6046 22.7678 21.6692 22.8584 20.4827L19.3005 16.7692L13.1787 22.605ZM9.9763 9.4663C11.2455 9.46657 12.2762 10.496 12.2763 11.7653C12.2763 13.0346 11.2456 14.065 9.9763 14.0653C8.70697 14.0651 7.67735 13.0347 7.67732 11.7653C7.67754 10.4961 8.70709 9.46659 9.9763 9.4663ZM19.921 4.53076C20.3416 4.11019 21.0233 4.11019 21.4438 4.53076L23.6682 6.75506C24.046 7.13358 24.0453 7.74716 23.6671 8.12541C23.2888 8.50331 22.6762 8.50309 22.2978 8.12541L21.6468 7.47441V11.414C21.6468 11.9495 21.2126 12.3835 20.6772 12.3837C20.1417 12.3836 19.7075 11.9495 19.7075 11.414V7.48493L19.0702 8.1212C18.6918 8.49913 18.0793 8.49917 17.7009 8.1212C17.3227 7.74286 17.3218 7.12933 17.6999 6.75086L19.921 4.53076Z"/></svg>;
}

const IconImageUpload = React.forwardRef(IconImageUploadComponent);
export default IconImageUpload;
