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 || 'hkgai';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Download${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 16 17" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M15.8125 10.25V15.25C15.8125 15.4986 15.7137 15.7371 15.5379 15.9129C15.3621 16.0887 15.1236 16.1875 14.875 16.1875H1.125C0.87636 16.1875 0.637903 16.0887 0.462087 15.9129C0.286272 15.7371 0.1875 15.4986 0.1875 15.25V10.25C0.1875 10.0014 0.286272 9.7629 0.462087 9.58709C0.637903 9.41127 0.87636 9.3125 1.125 9.3125C1.37364 9.3125 1.6121 9.41127 1.78791 9.58709C1.96373 9.7629 2.0625 10.0014 2.0625 10.25V14.3125H13.9375V10.25C13.9375 10.0014 14.0363 9.7629 14.2121 9.58709C14.3879 9.41127 14.6264 9.3125 14.875 9.3125C15.1236 9.3125 15.3621 9.41127 15.5379 9.58709C15.7137 9.7629 15.8125 10.0014 15.8125 10.25ZM7.33672 10.9133C7.42382 11.0007 7.52731 11.07 7.64126 11.1173C7.75522 11.1647 7.87739 11.189 8.00078 11.189C8.12417 11.189 8.24634 11.1647 8.3603 11.1173C8.47425 11.07 8.57775 11.0007 8.66484 10.9133L11.7898 7.78828C11.966 7.61216 12.0649 7.37329 12.0649 7.12422C12.0649 6.87515 11.966 6.63628 11.7898 6.46016C11.6137 6.28404 11.3749 6.18509 11.1258 6.18509C10.8767 6.18509 10.6378 6.28404 10.4617 6.46016L8.9375 7.98438V1.5C8.9375 1.25136 8.83873 1.0129 8.66291 0.837087C8.4871 0.661272 8.24864 0.5625 8 0.5625C7.75136 0.5625 7.5129 0.661272 7.33709 0.837087C7.16127 1.0129 7.0625 1.25136 7.0625 1.5V7.98438L5.53828 6.46172C5.45108 6.37451 5.34755 6.30534 5.23361 6.25814C5.11967 6.21095 4.99755 6.18666 4.87422 6.18666C4.62515 6.18666 4.38628 6.2856 4.21016 6.46172C4.12295 6.54892 4.05377 6.65245 4.00658 6.76639C3.95938 6.88033 3.93509 7.00245 3.93509 7.12578C3.93509 7.37485 4.03404 7.61372 4.21016 7.78984L7.33672 10.9133Z"/></svg>;
}

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