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

function IconTreeRulesComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = false, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-tree_rules${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : 'none'} viewBox="0 0 22 22" {...rest} ref={ref}><rect width="22" height="22" fill={useCurrentColor ? 'currentColor' : '#17BBBA'} rx="6"/><path fill={useCurrentColor ? 'currentColor' : '#fff'} d="m17.943 12.24-1.848-4.205h.373a.665.665 0 0 0 .656-.673.665.665 0 0 0-.656-.672h-1.955a.227.227 0 0 1-.107-.03L13.278 6a1.506 1.506 0 0 0-.76-.207h-.862v-1.12A.665.665 0 0 0 11 4a.665.665 0 0 0-.656.672v1.12h-.862c-.265 0-.529.073-.76.207l-1.127.662a.204.204 0 0 1-.107.029H5.533a.665.665 0 0 0-.657.672c0 .372.294.673.657.673h.373l-1.848 4.206a.684.684 0 0 0 .134.751l.463-.475c-.463.475-.463.475-.463.477l.002.002.004.005.014.014.04.035a2.898 2.898 0 0 0 .601.403c.407.21 1 .407 1.77.407s1.363-.198 1.77-.407a2.899 2.899 0 0 0 .602-.402l.04-.037.013-.013.004-.005.002-.002-.463-.477.463.475a.684.684 0 0 0 .134-.751L7.341 8.035h.142c.266 0 .529-.072.76-.207l1.127-.661c.033-.02.07-.03.108-.03h.862v8.518H8.152a.665.665 0 0 0-.656.673c0 .37.294.672.656.672h5.688a.665.665 0 0 0 .656-.672.665.665 0 0 0-.656-.673h-2.188V7.138h.862c.038 0 .075.01.108.029l1.128.661c.23.135.493.207.759.207h.143l-1.848 4.206a.684.684 0 0 0 .134.751l.463-.475c-.463.475-.463.475-.463.477l.002.002.005.005.013.014.04.035a2.896 2.896 0 0 0 .601.403c.408.21 1 .407 1.77.407s1.363-.198 1.77-.407a2.902 2.902 0 0 0 .602-.402l.04-.037.008-.008.005-.005.004-.005.002-.002-.463-.477.465.475a.678.678 0 0 0 .14-.751Z"/></svg>;
}

const IconTreeRules = React.forwardRef(IconTreeRulesComponent);
export default IconTreeRules;
