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

function IconUserinputComponent(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 || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-userinput${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 22 22" {...rest} ref={ref}><rect width="22" height="22" fill={useCurrentColor ? 'currentColor' : '#1759DD'} rx="6"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M16.108 14.369a.34.34 0 0 1 .328.246l.381 1.312a.384.384 0 0 1-.367.49H5.549a.383.383 0 0 1-.368-.49l.382-1.312a.341.341 0 0 1 .327-.245l10.218-.001Zm-1.107-8.785c.753 0 1.363.61 1.363 1.362v6.4a.341.341 0 0 1-.34.341H5.973a.341.341 0 0 1-.34-.341V6.947c0-.752.61-1.362 1.363-1.362H15v-.001ZM11.14 7.887c-.693 0-1.289.406-1.551.988l-.048.118-.095-.004c-.624 0-1.129.494-1.129 1.103 0 .572.447 1.044 1.02 1.097l.109.005h3.275v-.002l.053-.001a.975.975 0 0 0 .908-.962.973.973 0 0 0-.87-.957c-.131-.786-.83-1.385-1.671-1.385h-.001Z" clipRule="evenodd"/></svg>;
}

const IconUserinput = React.forwardRef(IconUserinputComponent);
export default IconUserinput;
