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

function IconEmailComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hkgai';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-email${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 20 16" fill="none" {...rest} ref={ref}><path d="M19.122 15.556H.876c-.486 0-.876-.428-.876-.954V.953C0 .426.392 0 .874 0h18.252c.484 0 .874.428.874.953v13.65c0 .525-.393.953-.878.953z" fill={useCurrentColor ? 'currentColor' : '#FFC736'}/><path d="M0 2.222v12.371c0 .534.392.963.874.963h.772L10 9.486 0 2.223zm10 7.265l8.356 6.069h.77c.484 0 .874-.434.874-.963V2.223L10 9.486z" fill={useCurrentColor ? 'currentColor' : '#FFB801'}/><path d="M1.111 15.556H18.89L10 8.889l-8.889 6.667z" fill={useCurrentColor ? 'currentColor' : '#FF8A01'}/></svg>;
}

const IconEmail = React.forwardRef(IconEmailComponent);
export default IconEmail;
