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

function IconExtractTextComponent(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-extract-text${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 16 16" {...rest} ref={ref}><path fill={useCurrentColor ? 'currentColor' : '#E4F3FC'} d="M0 5a5 5 0 0 1 5-5h6a5 5 0 0 1 5 5v6a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5V5Z"/><path fill={useCurrentColor ? 'currentColor' : '#24758E'} d="M8.74 12H7.26V5.382H3.5V4h9v1.382H8.74V12Z"/></svg>;
}

const IconExtractText = React.forwardRef(IconExtractTextComponent);
export default IconExtractText;
