index.tsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { memo } from 'react'
  2. import { useTranslation } from 'react-i18next'
  3. import type { NodeProps } from 'reactflow'
  4. import { RiHome5Fill } from '@remixicon/react'
  5. import Tooltip from '@/app/components/base/tooltip'
  6. import { NodeSourceHandle } from '@/app/components/workflow/nodes/_base/components/node-handle'
  7. const IterationStartNode = ({ id, data }: NodeProps) => {
  8. const { t } = useTranslation()
  9. return (
  10. <div className='group flex nodrag items-center justify-center w-11 h-11 mt-1 rounded-2xl border border-workflow-block-border bg-white'>
  11. <Tooltip popupContent={t('workflow.blocks.iteration-start')} asChild={false}>
  12. <div className='flex items-center justify-center w-6 h-6 rounded-full border-[0.5px] border-components-panel-border-subtle bg-util-colors-blue-brand-blue-brand-500'>
  13. <RiHome5Fill className='w-3 h-3 text-text-primary-on-surface' />
  14. </div>
  15. </Tooltip>
  16. <NodeSourceHandle
  17. id={id}
  18. data={data}
  19. handleClassName='!top-1/2 !-right-[9px] !-translate-y-1/2'
  20. handleId='source'
  21. />
  22. </div>
  23. )
  24. }
  25. export const IterationStartNodeDumb = () => {
  26. const { t } = useTranslation()
  27. return (
  28. <div className='relative left-[17px] top-[21px] flex nodrag items-center justify-center w-11 h-11 rounded-2xl border border-workflow-block-border bg-white z-[11]'>
  29. <Tooltip popupContent={t('workflow.blocks.iteration-start')} asChild={false}>
  30. <div className='flex items-center justify-center w-6 h-6 rounded-full border-[0.5px] border-components-panel-border-subtle bg-util-colors-blue-brand-blue-brand-500'>
  31. <RiHome5Fill className='w-3 h-3 text-text-primary-on-surface' />
  32. </div>
  33. </Tooltip>
  34. </div>
  35. )
  36. }
  37. export default memo(IterationStartNode)