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

function IconTreeTriggerComponent(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_trigger${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' : '#A061EF'}/><path fillRule="evenodd" clipRule="evenodd" d="M17.9232 10.813L17.9232 10.798C17.9232 7.52684 15.2714 4.875 12.0002 4.875C8.729 4.875 6.07716 7.52683 6.07714 10.798L6.07713 16.5C6.07713 16.7071 5.90924 16.875 5.70213 16.875H5.60547C5.39836 16.875 5.23047 17.0429 5.23047 17.25V18.75C5.23047 18.9571 5.39836 19.125 5.60547 19.125H18.3751C18.5822 19.125 18.7501 18.9571 18.7501 18.75V17.25C18.7501 17.0429 18.5822 16.875 18.3751 16.875H18.2982C18.0911 16.875 17.9232 16.7071 17.9232 16.5V10.813ZM10.7137 8.9368C10.746 8.87502 10.81 8.8363 10.8797 8.8363H13.7975C13.9539 8.8363 14.0416 9.01662 13.9449 9.13965L12.3334 11.1906C12.2368 11.3136 12.3244 11.4939 12.4809 11.4939H14.5143C14.6778 11.4939 14.7629 11.6885 14.6521 11.8086L10.8974 15.8762C10.7648 16.0198 10.5285 15.8903 10.5783 15.7013L11.2739 13.0579C11.3052 12.9391 11.2155 12.8227 11.0926 12.8227H8.98805C8.84711 12.8227 8.75656 12.6731 8.82195 12.5482L10.7137 8.9368Z" fill={useCurrentColor ? 'currentColor' : '#fff'}/></svg>;
}

const IconTreeTrigger = React.forwardRef(IconTreeTriggerComponent);
export default IconTreeTrigger;
