mirror of
https://github.com/langgenius/dify.git
synced 2026-11-13 14:51:39 +08:00
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>
40 lines
1.5 KiB
TypeScript
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
|