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 AddButton from '@/app/components/base/button/add-button' 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 (
: undefined } > {t(`${i18nPrefix}.code`, { ns: 'workflow' })}
} headerRight={(
{t(`${i18nPrefix}.codeSupportTip`, { ns: 'workflow' })}
)} value={inputs.template} onChange={handleCodeChange} />
<>
) } export default React.memo(Panel)