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

function IconTreeQAComponent(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_QA${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 24 24" fill={useCurrentColor ? 'currentColor' : 'none'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><rect width="24" height="24" rx="6" fill={useCurrentColor ? 'currentColor' : '#6E9FFF'}/><g fillRule="evenodd" clipRule="evenodd" fill={useCurrentColor ? 'currentColor' : '#fff'}><path opacity=".5" d="M18.4079 4.5H7.61693C6.87506 4.5 6.26807 5.10699 6.26807 5.84886V13.099C6.26807 13.8409 6.87506 14.4479 7.61693 14.4479H8.96854C8.42451 14.2696 8.03157 13.7578 8.03157 13.1542C8.03157 12.6431 8.31334 12.1977 8.73003 11.9651C8.78797 11.9327 8.8305 11.8776 8.84446 11.8127C9.06085 10.807 9.95519 10.0532 11.0256 10.0532C12.0959 10.0532 12.9902 10.8069 13.2067 11.8125C13.2207 11.8774 13.2632 11.9325 13.3212 11.9649C13.7381 12.1975 14.0201 12.6429 14.0201 13.1542C14.0201 13.7578 13.6271 14.2696 13.0831 14.4479H17.059L18.9025 16.2913C19.2175 16.6064 19.7563 16.3831 19.756 15.9375L19.75 5.84886C19.75 5.10699 19.1497 4.5 18.4079 4.5Z"/><path d="M11.0265 7.4353H16.5312C17.231 7.4353 17.8036 8.00789 17.8036 8.70772V16.3423C17.8036 17.0421 17.231 17.6147 16.5312 17.6147H6.79416L5.10355 19.3053C4.78848 19.6204 4.24975 19.3971 4.25 18.9515L4.25569 8.70772C4.25569 8.00789 4.82192 7.4353 5.52175 7.4353H11.0265ZM13.3214 11.9649C13.2634 11.9325 13.2208 11.8774 13.2069 11.8125C12.9904 10.807 12.0961 10.0533 11.0258 10.0533C9.95539 10.0533 9.06104 10.8071 8.84468 11.8129C8.83072 11.8778 8.7882 11.9329 8.73026 11.9652C8.31364 12.1979 8.03192 12.6432 8.03192 13.1543C8.03192 13.906 8.64126 14.5153 9.39293 14.5153H11.005L11.0258 14.5154L11.0466 14.5153H12.6594C13.411 14.5153 14.0204 13.906 14.0204 13.1543C14.0204 12.6429 13.7384 12.1975 13.3214 11.9649Z"/></g></svg>;
}

const IconTreeQA = React.forwardRef(IconTreeQAComponent);
export default IconTreeQA;
