dify/web/app/components/plugins/install-plugin/install-from-marketplace-query.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

42 lines
1.3 KiB
TypeScript

'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