Files
dify/web/app/components/workflow/nodes/human-input/shared/node-branches.tsx
T
8cbb6c0130 feat: HITL IM integration (#44864)
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: JzoNg <jzongcode@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-30 02:43:31 +00:00

40 lines
1.5 KiB
TypeScript

import type { HumanInputSharedNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types'
import { useTranslation } from 'react-i18next'
import { NodeSourceHandle } from '../../_base/components/node-handle'
import { HUMAN_INPUT_TIMEOUT_HANDLE } from './constants'
const HumanInputNodeBranches = <T extends HumanInputSharedNodeType>(props: NodeProps<T>) => {
const { t } = useTranslation(['workflow'])
const { user_actions: userActions } = props.data
return (
<div className="space-y-0.5 py-1">
{userActions.map((userAction) => (
<div key={userAction.id} className="relative flex flex-row-reverse items-center px-4 py-1">
<span className="truncate system-xs-semibold-uppercase text-text-secondary">
{userAction.id}
</span>
<NodeSourceHandle
{...props}
handleId={userAction.id}
handleClassName="top-1/2! -right-[9px]! -translate-y-1/2!"
/>
</div>
))}
<div className="relative flex flex-row-reverse items-center px-4 py-1">
<div className="truncate system-xs-semibold-uppercase text-text-secondary">
{t(($) => $['nodes.humanInput.timeout.title'], { ns: 'workflow' })}
</div>
<NodeSourceHandle
{...props}
handleId={HUMAN_INPUT_TIMEOUT_HANDLE}
handleClassName="top-1/2! -right-[9px]! -translate-y-1/2!"
/>
</div>
</div>
)
}
export default HumanInputNodeBranches