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

function IconTextProcessingComponent(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-text-processing${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 20 20" {...rest} ref={ref}><path fill={useCurrentColor ? 'currentColor' : '#40C6F0'} d="M15 0H5a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V5a5 5 0 0 0-5-5Z"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} fillRule="evenodd" d="M4 6.225C4 4.996 4.996 4 6.225 4h7.55C15.004 4 16 4.996 16 6.225v7.55A2.225 2.225 0 0 1 13.775 16h-7.55A2.225 2.225 0 0 1 4 13.775v-7.55Zm2.472 1.753c0-.336.272-.607.607-.607h5.842a.607.607 0 1 1 0 1.213h-2.314v4.337a.607.607 0 1 1-1.214 0V8.584H7.08a.607.607 0 0 1-.607-.606Z" clipRule="evenodd"/></svg>;
}

const IconTextProcessing = React.forwardRef(IconTextProcessingComponent);
export default IconTextProcessing;
