dify/web/app/components/plugins/marketplace/index.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

46 lines
1.6 KiB
TypeScript

import type { SearchParams } from 'nuqs'
import { PluginInstallPermissionProviderGuard } from '@/app/components/plugins/install-plugin/components/plugin-install-permission-provider'
import { TanstackQueryInitializer } from '@/context/query-client'
import Description from './description'
import { HydrateQueryClient } from './hydration-server'
import ListWrapper from './list/list-wrapper'
import StickySearchAndSwitchWrapper from './sticky-search-and-switch-wrapper'
type MarketplaceProps = {
showInstallButton?: boolean
pluginTypeSwitchClassName?: string
isMarketplacePlatform?: boolean
marketplaceNav?: React.ReactNode
/**
* Pass the search params from the request to prefetch data on the server.
*/
searchParams?: Promise<SearchParams>
}
const Marketplace = async ({
showInstallButton = false,
pluginTypeSwitchClassName,
isMarketplacePlatform = false,
marketplaceNav,
searchParams,
}: MarketplaceProps) => {
return (
<TanstackQueryInitializer>
<HydrateQueryClient searchParams={searchParams}>
<PluginInstallPermissionProviderGuard canInstallPlugin={showInstallButton}>
<Description
isMarketplacePlatform={isMarketplacePlatform}
marketplaceNav={marketplaceNav}
/>
{!isMarketplacePlatform && (
<StickySearchAndSwitchWrapper pluginTypeSwitchClassName={pluginTypeSwitchClassName} />
)}
<ListWrapper showInstallButton={showInstallButton} />
</PluginInstallPermissionProviderGuard>
</HydrateQueryClient>
</TanstackQueryInitializer>
)
}
export default Marketplace