import type { FC } from 'react' import type { AnswerNodeType } from './types' import type { NodePanelProps } from '@/app/components/workflow/types' import * as React from 'react' import { useTranslation } from 'react-i18next' import Editor from '@/app/components/workflow/nodes/_base/components/prompt/editor' import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list' import useConfig from './use-config' const i18nPrefix = 'nodes.answer' const Panel: FC> = ({ id, data }) => { const { t } = useTranslation() const { readOnly, inputs, handleAnswerChange, filterVar } = useConfig(id, data) const { availableVars, availableNodesWithParent } = useAvailableVarList(id, { onlyLeafNodeVar: false, hideChatVar: false, hideEnv: false, filterVar, }) return (
$[`${i18nPrefix}.answer`], { ns: 'workflow' })!} value={inputs.answer} onChange={handleAnswerChange} nodesOutputVars={availableVars} availableNodes={availableNodesWithParent} isSupportFileVar />
) } export default React.memo(Panel)