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

function IconTagComponent(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-tag${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 48 48" {...rest} ref={ref}><path d="M23.419 4.62a3.002 3.002 0 0 1 2.71-.82l12.964 2.593a3 3 0 0 1 2.3 2.133l.053.22 2.593 12.963a3 3 0 0 1-.821 2.709L23.09 44.547a3 3 0 0 1-4.242 0L3.292 28.99a3.001 3.001 0 0 1 0-4.243L23.419 4.62ZM6.827 26.868 20.97 41.011l19.04-19.042-2.358-11.786L25.87 7.826 6.827 26.868Zm24.75-13.521a3 3 0 1 1-2.996 3.154l-.004-.154.004-.155a3 3 0 0 1 2.996-2.845Zm.332 2.057a1 1 0 0 0-1.332.942l.005.103a1 1 0 0 0 .61.82 1 1 0 0 1 .717-1.865Z"/></svg>;
}

const IconTag = React.forwardRef(IconTagComponent);
export default IconTag;
