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

function IconWorkflowNodeComponent(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-workflow_node${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' : '#61C78A'}/><path d="M12 4C13.4387 4 14.7725 4.19311 15.7725 4.52637C16.2684 4.6917 16.7244 4.90536 17.0713 5.17871C17.4095 5.44528 17.7495 5.85822 17.75 6.41602V11.75C17.75 12.3084 17.4098 12.7215 17.0713 12.9883C16.7244 13.2617 16.2685 13.4753 15.7725 13.6406C14.9488 13.9151 13.8987 14.0917 12.75 14.1465V15.8086C13.2966 16.0199 13.7309 16.4536 13.9424 17H18.001L18.0771 17.0039C18.4551 17.0424 18.7509 17.3619 18.751 17.75C18.751 18.1382 18.4552 18.4575 18.0771 18.4961L18.001 18.5H13.9424C13.6408 19.2797 12.8857 19.8338 12 19.834C11.1142 19.8338 10.3599 19.2797 10.0586 18.5H6C5.58579 18.5 5.25 18.1642 5.25 17.75C5.25013 17.3359 5.58587 17 6 17H10.0586C10.2699 16.4536 10.7036 16.0199 11.25 15.8086V14.1465C10.1013 14.0917 9.05117 13.9151 8.22754 13.6406C7.73149 13.4753 7.27565 13.2617 6.92871 12.9883C6.59022 12.7215 6.25 12.3084 6.25 11.75V6.41602L6.25391 6.31348C6.29267 5.80727 6.61147 5.42873 6.92871 5.17871C7.27563 4.90536 7.73155 4.6917 8.22754 4.52637C9.22751 4.19311 10.5613 4 12 4ZM16.25 10.7891C16.0965 10.855 15.9374 10.9187 15.7725 10.9736C14.7725 11.3069 13.4388 11.501 12 11.501C10.5612 11.501 9.22753 11.3069 8.22754 10.9736C8.06263 10.9187 7.90352 10.855 7.75 10.7891V11.7051C7.76348 11.7235 7.79325 11.759 7.85742 11.8096C8.01646 11.9349 8.29259 12.0816 8.70117 12.2178C9.5108 12.4877 10.6775 12.667 12 12.667C13.3225 12.667 14.4892 12.4877 15.2988 12.2178C15.7074 12.0816 15.9835 11.9349 16.1426 11.8096C16.2067 11.759 16.2365 11.7235 16.25 11.7051V10.7891ZM16.25 8.12207C16.0965 8.18814 15.9374 8.25166 15.7725 8.30664C14.7725 8.63994 13.4388 8.83301 12 8.83301C10.5612 8.83301 9.22753 8.63994 8.22754 8.30664C8.0626 8.25166 7.90351 8.18814 7.75 8.12207V9.03906C7.76359 9.05759 7.79363 9.09328 7.85742 9.14355C8.01647 9.26883 8.2929 9.41465 8.70117 9.55078C9.5108 9.82065 10.6775 10.001 12 10.001C13.3225 10.001 14.4892 9.82065 15.2988 9.55078C15.7071 9.41465 15.9835 9.26883 16.1426 9.14355C16.2071 9.09269 16.2367 9.05647 16.25 9.03809V8.12207Z" fill={useCurrentColor ? 'currentColor' : '#fff'}/></svg>;
}

const IconWorkflowNode = React.forwardRef(IconWorkflowNodeComponent);
export default IconWorkflowNode;
