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.

1005 B
Raw Blame
'use client'
import type { FC } from 'react'
import type { PackageDependency, Plugin, VersionProps } from '../../../types'
import * as React from 'react'
import LoadingError from '../../base/loading-error'
import { pluginManifestToCardPluginProps } from '../../utils'
import LoadedItem from './loaded-item'

type Props = Readonly<{
  checked: boolean
  onCheckedChange: (plugin: Plugin) => void
  payload: PackageDependency
  isFromMarketPlace?: boolean
  versionInfo: VersionProps
}>

const PackageItem: FC<Props> = ({
  payload,
  checked,
  onCheckedChange,
  isFromMarketPlace,
  versionInfo,
}) => {
  if (!payload.value?.manifest) return <LoadingError />

  const plugin = pluginManifestToCardPluginProps(payload.value.manifest)
  return (
    <LoadedItem
      payload={{ ...plugin, from: payload.type }}
      checked={checked}
      onCheckedChange={onCheckedChange}
      isFromMarketPlace={isFromMarketPlace}
      versionInfo={versionInfo}
    />
  )
}

export default React.memo(PackageItem)