import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import useConfig from './use-config' import VarList from './components/var-list' import type { VariableAssignerNodeType } from './types' import Field from '@/app/components/workflow/nodes/_base/components/field' import Selector from '@/app/components/workflow/nodes/_base/components/selector' import AddButton from '@/app/components/base/button/add-button' import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows' import type { NodePanelProps } from '@/app/components/workflow/types' import { VarType } from '@/app/components/workflow/types' import Split from '@/app/components/workflow/nodes/_base/components/split' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' const i18nPrefix = 'workflow.nodes.variableAssigner' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const { readOnly, inputs, handleOutputTypeChange, handleVarListChange, handleAddVariable, handleOnVarOpen, filterVar, } = useConfig(id, data) const typeOptions = [ { label: t(`${i18nPrefix}.type.string`), value: VarType.string }, { label: t(`${i18nPrefix}.type.number`), value: VarType.number }, { label: t(`${i18nPrefix}.type.object`), value: VarType.object }, { label: t(`${i18nPrefix}.type.array`), value: VarType.array }, ] return (
{inputs.output_type}
{!readOnly && }
} popupClassName='!top-[36px] !w-[387px]' showChecked /> : undefined } >
<>
) } export default React.memo(Panel)