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

function IconAuthComponent(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-auth${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M24 2c5.979 0 10.843 4.765 10.996 10.711L35 13v3h7c1.055 0 1.918.82 1.995 1.851L44 18v26c0 1.05-.816 1.918-1.85 1.995L42 46H6a2.003 2.003 0 01-1.995-1.851L4 44V18c0-1.05.815-1.918 1.85-1.994L6 16h7v-3c0-6.08 4.925-11 11-11zm16 18H8v22h32V20zm-16 5c3.314 0 6 2.69 6 6s-2.686 6-6 6-6-2.69-6-6 2.686-6 6-6zm0 4c-1.105 0-2 .9-2 2s.895 2 2 2 2-.9 2-2-.895-2-2-2zm0-23c-3.785 0-6.87 3-6.996 6.76L17 13v3h14v-3c0-3.87-3.134-7-7-7z"/></svg>;
}

const IconAuth = React.forwardRef(IconAuthComponent);
export default IconAuth;
