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

function IconNistComponent(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-nist${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 18 18" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M1 3.96629C1 2.32805 2.32805 1 3.96629 1H14.0337C15.6719 1 17 2.32805 17 3.96629V14.0337C17 15.6719 15.6719 17 14.0337 17H3.96629C2.32805 17 1 15.6719 1 14.0337V3.96629ZM3.96629 2.61798C3.22164 2.61798 2.61798 3.22164 2.61798 3.96629V14.0337C2.61798 14.7783 3.22164 15.382 3.96629 15.382H14.0337C14.7783 15.382 15.382 14.7783 15.382 14.0337V3.96629C15.382 3.22164 14.7783 2.61798 14.0337 2.61798H3.96629Z"/><path d="M11.7276 4.99472C11.9106 4.99472 12.0593 5.05571 12.1736 5.1777C12.288 5.29968 12.3452 5.45217 12.3452 5.63514V12.3024C12.3452 12.5006 12.2765 12.6684 12.1393 12.8056C12.0097 12.9352 11.8458 13 11.6476 13C11.5484 13 11.4455 12.9848 11.3388 12.9543C11.2397 12.9161 11.1634 12.8666 11.1101 12.8056L6.61566 7.09897L6.913 6.91599V12.3596C6.913 12.5426 6.85201 12.695 6.73002 12.817C6.61566 12.939 6.46318 13 6.27258 13C6.0896 13 5.94093 12.939 5.82657 12.817C5.71221 12.695 5.65503 12.5426 5.65503 12.3596V5.69232C5.65503 5.4941 5.71983 5.33018 5.84944 5.20057C5.98668 5.06334 6.15441 4.99472 6.35263 4.99472C6.45937 4.99472 6.56992 5.01759 6.68428 5.06334C6.79864 5.10146 6.88251 5.16245 6.93587 5.24631L11.293 10.8043L11.0986 10.9415V5.63514C11.0986 5.45217 11.1558 5.29968 11.2702 5.1777C11.3845 5.05571 11.537 4.99472 11.7276 4.99472Z"/></svg>;
}

const IconNist = React.forwardRef(IconNistComponent);
export default IconNist;
