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

function IconSwitchComponent(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 || 'font';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Switch${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 16 16" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M6.99992 10.5834H4.87492C4.31133 10.5834 3.77099 10.8074 3.37248 11.2059 2.97396 11.6044 2.74992 12.1448 2.74992 12.7084V14.125C2.74992 14.5162 2.43279 14.8334 2.04159 14.8334 1.65038 14.8334 1.33325 14.5162 1.33325 14.125V12.7084C1.33325 11.769 1.70666 10.8685 2.37085 10.2043 3.03504 9.54009 3.93561 9.16669 4.87492 9.16669H6.99992V10.5834zM9.12492 4.20835C9.12492 3.03475 8.17352 2.08335 6.99992 2.08335 5.82631 2.08335 4.87492 3.03475 4.87492 4.20835 4.87492 5.38196 5.82631 6.33335 6.99992 6.33335 8.17352 6.33335 9.12492 5.38196 9.12492 4.20835zM10.5416 4.20835C10.5416 6.16436 8.95593 7.75002 6.99992 7.75002 5.04391 7.75002 3.45825 6.16436 3.45825 4.20835 3.45825 2.25235 5.04391.666687 6.99992.666687 8.95593.666687 10.5416 2.25234 10.5416 4.20835zM11.3299 9.33996L11.33 8.33499C11.33 8.14998 11.4657 8 11.6332 8 11.6978 8 11.7607 8.02275 11.8127 8.06495L14.5433 10.0753C14.6782 10.1851 14.7069 10.3948 14.6075 10.5437 14.5503 10.6294 14.4597 10.6799 14.3633 10.6799H8.90352C8.56851 10.6799 8.29693 10.38 8.29693 10.0099 8.29693 9.63992 8.56851 9.33996 8.90352 9.33996H11.3299zM11.3299 13.3598V14.3317C11.3299 14.5167 11.1941 14.6667 11.0266 14.6667 10.9621 14.6667 10.8992 14.6439 10.8472 14.6018L8.78019 13.1728 8.7823 13.1693 8.12158 12.6231C7.98747 12.5122 7.96013 12.3023 8.0605 12.1542 8.11776 12.0696 8.20774 12.0199 8.30332 12.0199H13.7563C14.0913 12.0199 14.3629 12.3198 14.3629 12.6899 14.3629 13.0599 14.0913 13.3598 13.7563 13.3598H11.3299z"/></svg>;
}

const IconSwitch = React.forwardRef(IconSwitchComponent);
export default IconSwitch;
