node.tsx 743 B

1234567891011121314151617181920212223242526
  1. import type { FC } from 'react'
  2. import React from 'react'
  3. import { useTranslation } from 'react-i18next'
  4. import InfoPanel from '../_base/components/info-panel'
  5. import ReadonlyInputWithSelectVar from '../_base/components/readonly-input-with-select-var'
  6. import type { AnswerNodeType } from './types'
  7. import type { NodeProps } from '@/app/components/workflow/types'
  8. const Node: FC<NodeProps<AnswerNodeType>> = ({
  9. id,
  10. data,
  11. }) => {
  12. const { t } = useTranslation()
  13. return (
  14. <div className='mb-1 px-3 py-1'>
  15. <InfoPanel title={t('workflow.nodes.answer.answer')} content={
  16. <ReadonlyInputWithSelectVar
  17. value={data.answer}
  18. nodeId={id}
  19. />
  20. } />
  21. </div>
  22. )
  23. }
  24. export default React.memo(Node)