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

function IconRedoComponent(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-redo${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="M31.878 24.778a1 1 0 000 1.415l1.415 1.414a1 1 0 001.414 0l9.192-9.193a2 2 0 000-2.828l-9.192-9.193a1 1 0 00-1.414 0l-1.415 1.415a1 1 0 000 1.414L37.658 15H18.413c-7.732 0-14 6.268-14 14s6.268 14 14 14h8.728a1 1 0 001-1v-1.96a1 1 0 00-1-1h-8.258c-3.866 0-10-4.001-10-10.04 0-6.039 6.134-10 10-10h18.772l-5.777 5.778z"/></svg>;
}

const IconRedo = React.forwardRef(IconRedoComponent);
export default IconRedo;
