You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

node.tsx 959B

123456789101112131415161718192021222324252627282930
  1. import type { FC } from 'react'
  2. import React from 'react'
  3. import ReadonlyInputWithSelectVar from '../_base/components/readonly-input-with-select-var'
  4. import type { HttpNodeType } from './types'
  5. import type { NodeProps } from '@/app/components/workflow/types'
  6. const Node: FC<NodeProps<HttpNodeType>> = ({
  7. id,
  8. data,
  9. }) => {
  10. const { method, url } = data
  11. if (!url)
  12. return null
  13. return (
  14. <div className='mb-1 px-3 py-1'>
  15. <div className='flex items-center justify-start rounded-md bg-workflow-block-parma-bg p-1'>
  16. <div className='flex h-4 shrink-0 items-center rounded bg-components-badge-white-to-dark px-1 text-xs font-semibold uppercase text-text-secondary'>{method}</div>
  17. <div className='pl-1 pt-1'>
  18. <ReadonlyInputWithSelectVar
  19. className='text-text-secondary'
  20. value={url}
  21. nodeId={id}
  22. />
  23. </div>
  24. </div>
  25. </div>
  26. )
  27. }
  28. export default React.memo(Node)