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

function IconUndoComponent(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-undo${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="M16.121 24.778a1 1 0 010 1.415l-1.414 1.414a1 1 0 01-1.414 0L4.1 18.414a2 2 0 010-2.828l9.193-9.193a1 1 0 011.414 0l1.414 1.415a1 1 0 010 1.414L10.343 15h19.243c7.732 0 14 6.268 14 14s-6.268 14-14 14h-8.729a1 1 0 01-1-1v-1.96a1 1 0 011-1h8.259c3.866 0 10-4.001 10-10.04 0-6.039-6.134-10-10-10H10.344l5.777 5.778z"/></svg>;
}

const IconUndo = React.forwardRef(IconUndoComponent);
export default IconUndo;
