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

function IconUserComponent(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-user${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M6.789 3.618a5.863 5.863 0 1 1 10.832 4.49A5.863 5.863 0 0 1 6.79 3.618ZM1.655 18.76v1.725A3.518 3.518 0 0 0 5.178 24h14.057a3.517 3.517 0 0 0 3.523-3.516V18.76a3.451 3.451 0 0 0-1.999-2.957 22.946 22.946 0 0 0-17.105 0 3.451 3.451 0 0 0-2 2.957Z" clipRule="evenodd"/></svg>;
}

const IconUser = React.forwardRef(IconUserComponent);
export default IconUser;
