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.

1.3 KB
Raw Blame
'use client'

import type { PluginCategoryEnum, PluginManifestInMarket } from '../types'
import type { UseInstallFromMarketplaceQueryOptions } from './hooks/use-install-from-marketplace-query'
import { useInstallFromMarketplaceQuery as useInstallFromMarketplaceQueryHook } from './hooks/use-install-from-marketplace-query'
import InstallFromMarketplace from './install-from-marketplace'

type InstallFromMarketplaceQueryProps = UseInstallFromMarketplaceQueryOptions & {
  installContextCategory?: PluginCategoryEnum
}

const InstallFromMarketplaceQuery = ({
  installContextCategory,
  ...options
}: InstallFromMarketplaceQueryProps) => {
  const {
    bundleInfo,
    dependencies,
    hideInstallFromMarketplace,
    isShowInstallFromMarketplace,
    marketplaceInstall,
  } = useInstallFromMarketplaceQueryHook(options)

  if (!isShowInstallFromMarketplace) return null

  if (!marketplaceInstall && !bundleInfo) return null

  return (
    <InstallFromMarketplace
      manifest={marketplaceInstall?.manifest as PluginManifestInMarket}
      uniqueIdentifier={marketplaceInstall?.uniqueIdentifier ?? ''}
      isBundle={!!bundleInfo}
      dependencies={dependencies}
      installContextCategory={installContextCategory}
      onClose={hideInstallFromMarketplace}
      onSuccess={hideInstallFromMarketplace}
    />
  )
}

export default InstallFromMarketplaceQuery