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

function IconModeComponent(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-mode${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="M11.896 2a9.894 9.894 0 0 1 9.302 6.5h-1.946a8.097 8.097 0 0 0-14.49-.425 8.103 8.103 0 0 0 .396 8.312.9.9 0 0 1 .093.814l-.95 2.531 3.492-.632a.9.9 0 0 1 .555.078 8.11 8.11 0 0 0 1.152.457v1.869a9.888 9.888 0 0 1-1.67-.581l-4.77.863a.9.9 0 0 1-1.002-1.203l1.351-3.596A9.902 9.902 0 0 1 11.896 2ZM7.38 7.68a.9.9 0 0 0 0 1.8h3.45a.9.9 0 0 0 0-1.8H7.38Zm0 4a.9.9 0 1 0 0 1.8h1a.9.9 0 0 0 0-1.8h-1Zm8.766-2.095h-.002a1.712 1.712 0 0 0-1.592 1.095l-.262.674-.758.43-.728-.11-.014-.003a1.712 1.712 0 0 0-1.711.838l-.346.604a1.71 1.71 0 0 0 .14 1.929l.463.573v.856l-.448.569a1.711 1.711 0 0 0-.138 1.926l.344.6.002.004a1.71 1.71 0 0 0 1.711.838l.74-.113.742.427.263.678a1.71 1.71 0 0 0 1.592 1.094h.73a1.711 1.711 0 0 0 1.591-1.095l.263-.677.743-.427.725.11.014.003a1.712 1.712 0 0 0 1.711-.838l.003-.004.343-.6a1.71 1.71 0 0 0-.14-1.929l-.463-.573v-.856l.448-.569a1.71 1.71 0 0 0 .138-1.926l-.343-.6-.003-.004a1.71 1.71 0 0 0-1.711-.838l-.74.113-.742-.427-.263-.678a1.711 1.711 0 0 0-1.592-1.094h-.71Zm-.006 1.7a.015.015 0 0 1 .008-.003h.704c.003 0 .006 0 .008.003a.018.018 0 0 1 .006.007l.37.957c.07.181.2.333.369.43l1.26.724a.848.848 0 0 0 .551.103l1.006-.153.008.001a.014.014 0 0 1 .005.006l.344.6.005.009a.014.014 0 0 1-.001.015l-.634.807a.85.85 0 0 0-.181.524v1.449c0 .194.066.382.188.533l.644.799a.014.014 0 0 1 .003.007c0 .002 0 .005-.002.007l-.348.61a.014.014 0 0 1-.006.005.016.016 0 0 1-.007.001l-1.007-.153a.849.849 0 0 0-.55.103l-1.26.725a.848.848 0 0 0-.369.428l-.372.959a.013.013 0 0 1-.005.006.015.015 0 0 1-.008.003h-.72a.015.015 0 0 1-.009-.003.018.018 0 0 1-.006-.007l-.37-.957a.847.847 0 0 0-.369-.43l-1.26-.724a.849.849 0 0 0-.551-.103l-1.006.153-.008-.001a.014.014 0 0 1-.005-.006l-.344-.6-.005-.009a.014.014 0 0 1 .001-.015l.634-.807a.85.85 0 0 0 .181-.524v-1.449a.848.848 0 0 0-.188-.533l-.644-.799a.014.014 0 0 1-.003-.007c0-.002 0-.005.002-.007l.348-.61a.014.014 0 0 1 .006-.005.015.015 0 0 1 .007-.001l1.007.153a.848.848 0 0 0 .546-.1l1.278-.725a.849.849 0 0 0 .372-.431l.372-.959a.015.015 0 0 1 .005-.006Zm.36 2.181a2.576 2.576 0 0 0-2.575 2.573 2.573 2.573 0 0 0 4.395 1.82 2.573 2.573 0 0 0-1.82-4.393Zm-.621 1.954a.879.879 0 0 1 1.499.62.875.875 0 0 1-.878.876.879.879 0 0 1-.878-.877c0-.232.092-.455.257-.619Z" clipRule="evenodd"/></svg>;
}

const IconMode = React.forwardRef(IconModeComponent);
export default IconMode;
