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

function IconScaleComponent(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-scale${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="m4.515 3.146-.707.708a.5.5 0 0 0 0 .707L8.65 9.403H5.69c-.223 0-.303.024-.385.067a.454.454 0 0 0-.189.19c-.044.08-.067.162-.067.384v.719c0 .223.023.303.067.385a.454.454 0 0 0 .189.189c.082.043.162.067.385.067h5.36a1 1 0 0 0 1-1v-5.36c0-.222-.024-.303-.067-.385a.456.456 0 0 0-.19-.189c-.081-.043-.162-.066-.385-.066h-.718c-.223 0-.303.023-.385.066a.454.454 0 0 0-.189.19c-.044.08-.067.162-.067.385v2.93L5.222 3.146a.5.5 0 0 0-.707 0ZM13.661 12a1 1 0 0 0-1 1v5.5a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-3l4.778 4.778a.5.5 0 0 0 .707 0l.708-.707a.5.5 0 0 0 0-.707L15.99 14h3.171a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-5.5Z" clipRule="evenodd"/></svg>;
}

const IconScale = React.forwardRef(IconScaleComponent);
export default IconScale;
