-
-
+
+
+
+
+
+ {
+ enable_marketplace && (
+
+ )
+ }
)
}
-export default DataSourcePage
+export default memo(DataSourcePage)
diff --git a/web/app/components/header/account-setting/data-source-page-new/install-from-marketplace.tsx b/web/app/components/header/account-setting/data-source-page-new/install-from-marketplace.tsx
new file mode 100644
index 0000000000..da3738d0f2
--- /dev/null
+++ b/web/app/components/header/account-setting/data-source-page-new/install-from-marketplace.tsx
@@ -0,0 +1,80 @@
+import { useCallback, useState } from 'react'
+import { useTheme } from 'next-themes'
+import { useTranslation } from 'react-i18next'
+import Link from 'next/link'
+import {
+ RiArrowDownSLine,
+ RiArrowRightUpLine,
+} from '@remixicon/react'
+import {
+ useMarketplaceAllPlugins,
+} from './hooks'
+import Divider from '@/app/components/base/divider'
+import Loading from '@/app/components/base/loading'
+import ProviderCard from '@/app/components/plugins/provider-card'
+import List from '@/app/components/plugins/marketplace/list'
+import type { Plugin } from '@/app/components/plugins/types'
+import cn from '@/utils/classnames'
+import { getLocaleOnClient } from '@/i18n'
+import { getMarketplaceUrl } from '@/utils/var'
+
+type InstallFromMarketplaceProps = {
+ providers: any[]
+ searchText: string
+}
+const InstallFromMarketplace = ({
+ providers,
+ searchText,
+}: InstallFromMarketplaceProps) => {
+ const { t } = useTranslation()
+ const { theme } = useTheme()
+ const [collapse, setCollapse] = useState(false)
+ const locale = getLocaleOnClient()
+ const {
+ plugins: allPlugins,
+ isLoading: isAllPluginsLoading,
+ } = useMarketplaceAllPlugins(providers, searchText)
+
+ const cardRender = useCallback((plugin: Plugin) => {
+ if (plugin.type === 'bundle')
+ return null
+
+ return
+ }, [])
+
+ return (
+
+
+
+
setCollapse(!collapse)}>
+
+ {t('common.modelProvider.installProvider')}
+
+
+ {t('common.modelProvider.discoverMore')}
+
+ {t('plugin.marketplace.difyMarketplace')}
+
+
+
+
+ {!collapse && isAllPluginsLoading &&
}
+ {
+ !isAllPluginsLoading && !collapse && (
+
+ )
+ }
+
+ )
+}
+
+export default InstallFromMarketplace