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

function IconSwitchoverComponent(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-switchover${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 24 24" {...rest} ref={ref}><path fillRule="evenodd" d="M21 8.375a.5.5 0 0 0-.5-.5H9.462V4.8a.3.3 0 0 0-.483-.237L3.264 9.011a.5.5 0 0 0-.124.14.5.5 0 0 0 .358.85H20.5A.5.5 0 0 0 21 9.5V8.375Zm-.09 5.835a.5.5 0 0 0-.407-.21H3.502a.5.5 0 0 0-.5.5v1.126a.5.5 0 0 0 .5.499h11.037V19.2a.3.3 0 0 0 .485.237l5.715-4.448a.498.498 0 0 0 .124-.14.5.5 0 0 0 .048-.64Z" clipRule="evenodd"/></svg>;
}

const IconSwitchover = React.forwardRef(IconSwitchoverComponent);
export default IconSwitchover;
