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

function IconUserIdComponent(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-user-id${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 20 19" fill="none" {...rest} ref={ref}><rect width="20" height="16" rx="2" fill={useCurrentColor ? 'currentColor' : '#FF7D00'}/><rect opacity=".4" x="1" y="3.5" width="18" height="15" rx="2" fill={useCurrentColor ? 'currentColor' : '#FF7D00'}/><rect x="3" y="4.5" width="9" height="1.6" rx=".8" fill={useCurrentColor ? 'currentColor' : '#fff'}/><rect x="3" y="7.5" width="9" height="1.6" rx=".8" fill={useCurrentColor ? 'currentColor' : '#fff'}/><rect opacity=".5" x="11" y="11.5" width="6" height="1.6" rx=".8" fill={useCurrentColor ? 'currentColor' : '#fff'}/></svg>;
}

const IconUserId = React.forwardRef(IconUserIdComponent);
export default IconUserId;
