import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import { RiArrowRightSLine, } from '@remixicon/react' import VarReferencePicker from '../_base/components/variable/var-reference-picker' import Split from '../_base/components/split' import ResultPanel from '../../run/result-panel' import IterationResultPanel from '../../run/iteration-result-panel' import type { IterationNodeType } from './types' import useConfig from './use-config' import { InputVarType, type NodePanelProps } from '@/app/components/workflow/types' import Field from '@/app/components/workflow/nodes/_base/components/field' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' const i18nPrefix = 'workflow.nodes.iteration' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const { readOnly, inputs, filterInputVar, handleInputChange, childrenNodeVars, iterationChildrenNodes, handleOutputVarChange, isShowSingleRun, hideSingleRun, isShowIterationDetail, backToSingleRun, showIterationDetail, hideIterationDetail, runningStatus, handleRun, handleStop, runResult, inputVarValues, setInputVarValues, usedOutVars, iterator, setIterator, iteratorInputKey, iterationRunResult, } = useConfig(id, data) return (
Array
)} >
Array
)} > {isShowSingleRun && ( setIterator((keyValue as any)[iteratorInputKey]), }, ]} runningStatus={runningStatus} onRun={handleRun} onStop={handleStop} result={
{t(`${i18nPrefix}.iteration`, { count: iterationRunResult.length })}
} /> )} {isShowIterationDetail && ( )} ) } export default React.memo(Panel)