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.

777 B
Raw Blame
import type { Node } from '../types'
import { memo } from 'react'
import { CUSTOM_NODE } from '../constants'
import { getNodeCatalogType } from '../utils/node'
import BasePanel from './_base/components/workflow-panel'
import { PanelComponentMap } from './panel-components'

type PanelProps = {
  type: Node['type']
  id: Node['id']
  data: Node['data']
}
const Panel = memo((props: PanelProps) => {
  const nodeClass = props.type
  const nodeData = props.data
  if (nodeClass !== CUSTOM_NODE) return null

  const PanelComponent = PanelComponentMap[nodeData.type]!

  return (
    <BasePanel key={`${props.id}-${getNodeCatalogType(nodeData)}`} id={props.id} data={props.data}>
      <PanelComponent />
    </BasePanel>
  )
})

Panel.displayName = 'Panel'

export default Panel