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

function IconSwapComponent(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-swap${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_f0a1dfdc67__svg_f0a1dfdc67__clip0)"><path fillRule="evenodd" clipRule="evenodd" d="M5 14.827v2a1 1 0 00.883.994l.117.006h36.5c1.756 0 2.637-2.084 1.483-3.343l-.107-.108L33.65 4.688a1 1 0 00-1.322-.048l-.092.086-1.375 1.452a1 1 0 00-.048 1.322l.086.092 6.582 6.235H6a1 1 0 00-.994.884L5 14.827v2-2zM42 30H5.5c-1.756 0-2.637 2.084-1.483 3.343l.108.109L14.35 43.14a1 1 0 001.321.047l.092-.086 1.376-1.451a1 1 0 00.047-1.322l-.085-.092L10.519 34H42a1 1 0 00.993-.883L43 33v-2a1 1 0 00-.883-.993L42 30H5.5 42z"/></g><defs><clipPath id="svg_f0a1dfdc67__svg_f0a1dfdc67__clip0"><path d="M0 0h48v48H0z"/></clipPath></defs></svg>;
}

const IconSwap = React.forwardRef(IconSwapComponent);
export default IconSwap;
