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

function IconRetryComponent(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-retry${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}><g clipPath="url(#svg_165e6d21e0__svg_165e6d21e0__clip0_9868_144708)"><path fillRule="evenodd" clipRule="evenodd" d="M42.8308 23.1427L47.9097 28.4455C48.0312 28.5723 48.0312 28.778 47.9097 28.9049C47.8513 28.9658 47.7722 29 47.6897 29L44.4018 29.0006C42.1584 38.1843 33.8756 45 24.0008 45C14.1257 45 5.8426 38.1838 3.59961 28.9996L7.74786 28.9995C9.88286 35.9485 16.3519 41 24.0008 41C31.6493 41 38.1181 35.9489 40.2534 29.0005L37.3119 29C37.1401 29 37.0008 28.8546 37.0008 28.6752C37.0008 28.589 37.0336 28.5064 37.0919 28.4455L42.1708 23.1427C42.3531 22.9524 42.6486 22.9524 42.8308 23.1427ZM0.311127 19H10.6889C10.7714 19 10.8505 19.0342 10.9089 19.0951C11.013 19.2039 11.0279 19.3705 10.9535 19.4958L10.9089 19.5545L5.83 24.8573C5.67053 25.0238 5.42436 25.0446 5.24321 24.9197L5.17 24.8573L0.091127 19.5545C0.0327794 19.4936 0 19.411 0 19.3248C0 19.1711 0.10234 19.0422 0.239788 19.0086L0.311127 19H10.6889H0.311127ZM24.0006 3C33.8757 3 42.1588 9.81616 44.4018 19.0004L40.2535 19.0005C38.1185 12.0515 31.6495 7 24.0006 7C16.352 7 9.88324 12.0511 7.74793 18.9995L3.59961 18.9994C5.84296 9.81567 14.1258 3 24.0006 3Z"/></g><defs><clipPath id="svg_165e6d21e0__svg_165e6d21e0__clip0_9868_144708"><path d="M0 0H48V48H0z"/></clipPath></defs></svg>;
}

const IconRetry = React.forwardRef(IconRetryComponent);
export default IconRetry;
