import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import { RiQuestionLine, } from '@remixicon/react' import { CodeLanguage } from '../code/types' import useConfig from './use-config' import type { TemplateTransformNodeType } from './types' import VarList from '@/app/components/workflow/nodes/_base/components/variable/var-list' import AddButton from '@/app/components/base/button/add-button' import Field from '@/app/components/workflow/nodes/_base/components/field' import Split from '@/app/components/workflow/nodes/_base/components/split' import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor/editor-support-vars' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import type { NodePanelProps } from '@/app/components/workflow/types' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' import ResultPanel from '@/app/components/workflow/run/result-panel' const i18nPrefix = 'workflow.nodes.templateTransform' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const { readOnly, inputs, availableVars, handleVarListChange, handleVarNameChange, handleAddVariable, handleAddEmptyVariable, handleCodeChange, filterVar, // single run isShowSingleRun, hideSingleRun, runningStatus, handleRun, handleStop, varInputs, inputVarValues, setInputVarValues, runResult, } = useConfig(id, data) return (
: undefined } > {t(`${i18nPrefix}.code`)}
} headerRight={
{t(`${i18nPrefix}.codeSupportTip`)}
} value={inputs.template} onChange={handleCodeChange} />
<>
{isShowSingleRun && ( } /> )} ) } export default React.memo(Panel)