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

function IconDownloadComponent(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 || 'font';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Download${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 24 24" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M20 5C21.1046 5 22 5.89543 22 7V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V7C2 5.89543 2.89543 5 4 5H11V12.5859L7.70703 9.29297C7.31652 8.90246 6.6835 8.90248 6.29297 9.29297 5.90244 9.68349 5.90244 10.3165 6.29297 10.707L11.293 15.707C11.6835 16.0975 12.3165 16.0975 12.707 15.707L17.707 10.707C18.0975 10.3165 18.0975 9.68348 17.707 9.29297 17.3165 8.90246 16.6835 8.90248 16.293 9.29297L13 12.5859V5H20zM12 2C12.5523 2.00004 13 2.44774 13 3V5H11V3C11 2.44772 11.4477 2 12 2z"/></svg>;
}

const IconDownload = React.forwardRef(IconDownloadComponent);
export default IconDownload;
