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

function IconLLMComponent(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-LLM${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 24 24" {...rest} ref={ref}><rect width="24" height="24" fill={useCurrentColor ? 'currentColor' : '#000'} rx="7"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M5.595 8.746A.397.397 0 0 0 5 9.084v5.99c0 .21.057.418.164.6.107.183.262.334.448.44l4.971 2.806a.616.616 0 0 0 .83-.22.592.592 0 0 0 .082-.299v-6.29a.052.052 0 0 0-.027-.049L5.595 8.747ZM12 4a.616.616 0 0 0-.303.08L5.894 7.357a.242.242 0 0 0-.123.208.237.237 0 0 0 .123.208l5.8 3.275a.616.616 0 0 0 .605 0l5.804-3.278a.24.24 0 0 0 .09-.328.24.24 0 0 0-.09-.088l-5.8-3.274A.616.616 0 0 0 12 4Zm7 11.075v-5.99a.389.389 0 0 0-.2-.34.403.403 0 0 0-.397-.001l-5.867 3.314a.06.06 0 0 0-.03.053v6.29a.593.593 0 0 0 .303.518.616.616 0 0 0 .608.002l4.971-2.808A1.19 1.19 0 0 0 19 15.075Z" clipRule="evenodd"/></svg>;
}

const IconLLM = React.forwardRef(IconLLMComponent);
export default IconLLM;
