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

function IconPromiseComponent(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-promise${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M26.572 3.648c1.228.827 1.997 1.331 2.213 1.454a29.236 29.236 0 003.736 1.796c1.17.464 2.472.8 3.842 1.004a17.659 17.659 0 001.606.165h.026l1.477.024c1.913.03 3.42 1.506 3.52 3.31l.004.188v.153l.001 1.378.001 2.45v1.2L43 17.836v.028l.002 1.125-4 .03-.002-1.153V16.771l-.001-1.606v-.406l-.001-1.638v-1.22l-1.044-.016c-.126 0-.392-.015-.647-.034a21.815 21.815 0 01-1.559-.177c-1.674-.249-3.284-.666-4.76-1.251a33.318 33.318 0 01-4.26-2.048c-.297-.17-.94-.588-1.993-1.293l-.232-.156-.555.395c-.253.194-1.003.664-1.679 1.051a33.67 33.67 0 01-4.26 2.051c-1.473.585-3.082 1.002-4.757 1.251-.542.08-1.066.14-1.559.177-.211.016-.443.03-.552.032l-.043.001-1.097.018v14.4c0 6.369 8.625 14.879 14.498 14.879.783 0 1.614-.151 2.467-.428l3.02 2.916c-1.85.846-3.722 1.33-5.487 1.33-8.024 0-18.27-10.023-18.494-18.418L6 26.302V11.591C6 9.764 7.444 8.228 9.328 8.1l.196-.009 1.54-.024c-.015 0 .03-.003.096-.007l.217-.015c.39-.029.815-.077 1.258-.143 1.37-.203 2.672-.54 3.836-1.002a29.585 29.585 0 003.74-1.8 22.677 22.677 0 001.243-.765l.043-.031.887-.349c1.246-.888 2.932-1.18 4.188-.307zm7.426 19.585c2.713-1.857 6.491-1.615 8.927.719 2.767 2.652 2.767 6.977.01 9.617l-6.753 6.558-.033.032a3.17 3.17 0 01-4.347-.045l-6.727-6.536a6.62 6.62 0 01.004-9.63l.02-.019c2.437-2.314 6.196-2.545 8.9-.696zm1.898 3.592c1.165-1.105 3.097-1.1 4.261.015 1.124 1.077 1.124 2.774 0 3.85L34 36.671 27.853 30.7c-1.134-1.087-1.134-2.784-.01-3.86l.013-.013c1.166-1.107 3.097-1.102 4.261.013l.495.475 1.383 1.33 1.88-1.8.021-.02z"/></svg>;
}

const IconPromise = React.forwardRef(IconPromiseComponent);
export default IconPromise;
