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

function IconEnComponent(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-en${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="M4.30321 2.06641C3.08818 2.06641 2.10321 3.05138 2.10321 4.26641V11.7331C2.10321 12.9481 3.08818 13.9331 4.30321 13.9331H11.7699C12.9849 13.9331 13.9699 12.9481 13.9699 11.7331V4.26641C13.9699 3.05138 12.9849 2.06641 11.7699 2.06641H4.30321ZM3.30321 4.26641C3.30321 3.71412 3.75093 3.26641 4.30321 3.26641H11.7699C12.3222 3.26641 12.7699 3.71412 12.7699 4.26641V11.7331C12.7699 12.2854 12.3222 12.7331 11.7699 12.7331H4.30321C3.75093 12.7331 3.30321 12.2854 3.30321 11.7331V4.26641ZM7.90815 10.5091V9.50578H5.44815V8.65245H7.75148V7.65245H5.44815V6.84578H7.89482V5.84245H4.33482V10.5091H7.90815ZM11.7474 8.36245C11.7474 7.60578 11.2408 7.14911 10.5874 7.14911C10.1508 7.14911 9.82076 7.30578 9.61409 7.64911V7.23911H8.61409V10.5091H9.65742V8.74911C9.65742 8.32578 9.89742 8.12911 10.1874 8.12911C10.5108 8.12911 10.7041 8.34578 10.7041 8.73245V10.5091H11.7474V8.36245Z" clipRule="evenodd"/></svg>;
}

const IconEn = React.forwardRef(IconEnComponent);
export default IconEn;
