import type { FC } from 'react' import type { TemplateTransformNodeType } from './types' import type { NodePanelProps } from '@/app/components/workflow/types' import { RiQuestionLine } from '@remixicon/react' import * as React from 'react' import { useTranslation } from 'react-i18next' import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor/editor-support-vars' import Field from '@/app/components/workflow/nodes/_base/components/field' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import Split from '@/app/components/workflow/nodes/_base/components/split' import VarList from '@/app/components/workflow/nodes/_base/components/variable/var-list' import { CodeLanguage } from '../code/types' import useConfig from './use-config' const i18nPrefix = 'nodes.templateTransform' const Panel: FC> = ({ id, data }) => { const { t } = useTranslation() const { readOnly, inputs, availableVars, handleVarListChange, handleVarNameChange, handleAddVariable, handleAddEmptyVariable, handleCodeChange, filterVar, } = useConfig(id, data) return (
$[`${i18nPrefix}.inputVars`], { ns: 'workflow' })} operations={ !readOnly ? ( ) : undefined } > {t(($) => $[`${i18nPrefix}.code`], { ns: 'workflow' })}
} headerRight={
{t(($) => $[`${i18nPrefix}.codeSupportTip`], { ns: 'workflow' })}
} value={inputs.template} onChange={handleCodeChange} />
<> $[`${i18nPrefix}.outputVars.output`], { ns: 'workflow' })} />
) } export default React.memo(Panel)