Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

807 B
Raw Blame
import type { Node } from './types'
import useNodes from '@/app/components/workflow/store/workflow/use-nodes'
import { NodeActionsContextMenuContent } from './node-actions-menu/context-menu-content'
import { useStore } from './store'

export function NodeContextmenu({ onClose }: { onClose: () => void }) {
  const nodes = useNodes()
  const contextMenuTarget = useStore((s) => s.contextMenuTarget)
  const nodeId = contextMenuTarget?.type === 'node' ? contextMenuTarget.nodeId : undefined
  const currentNode = nodeId
    ? (nodes.find((node) => node.id === nodeId) as Node | undefined)
    : undefined

  if (!nodeId || !currentNode) return null

  return (
    <NodeActionsContextMenuContent
      id={currentNode.id}
      data={currentNode.data}
      onClose={onClose}
      showHelpLink
    />
  )
}