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

function IconDataEnhanceComponent(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-data_enhance${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 20 20" fill={useCurrentColor ? 'currentColor' : 'none'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><rect width="20" height="20" rx="6" fill={useCurrentColor ? 'currentColor' : '#8CCA4E'}/><path d="M8.54159 4.16699H13.7916L10.5833 8.25033H14.9583L7.95825 15.8337L9.41658 10.292H5.33325L8.54159 4.16699Z" fill={useCurrentColor ? 'currentColor' : '#fff'}/></svg>;
}

const IconDataEnhance = React.forwardRef(IconDataEnhanceComponent);
export default IconDataEnhance;
