import type { useMarketplace } from './hooks' import { RiArrowRightUpLine, RiArrowUpDoubleLine, } from '@remixicon/react' import { useTheme } from 'next-themes' import { useTranslation } from 'react-i18next' import Loading from '@/app/components/base/loading' import List from '@/app/components/plugins/marketplace/list' import { getLocaleOnClient } from '@/i18n-config' import { getMarketplaceUrl } from '@/utils/var' type MarketplaceProps = { searchPluginText: string filterPluginTags: string[] isMarketplaceArrowVisible: boolean showMarketplacePanel: () => void marketplaceContext: ReturnType } const Marketplace = ({ searchPluginText, filterPluginTags, isMarketplaceArrowVisible, showMarketplacePanel, marketplaceContext, }: MarketplaceProps) => { const locale = getLocaleOnClient() const { t } = useTranslation() const { theme } = useTheme() const { isLoading, marketplaceCollections, marketplaceCollectionPluginsMap, plugins, page, } = marketplaceContext return ( <>
{isMarketplaceArrowVisible && ( )}
{t('marketplace.moreFrom', { ns: 'plugin' })}
{t('marketplace.discover', { ns: 'plugin' })} {t('category.models', { ns: 'plugin' })} , {t('category.tools', { ns: 'plugin' })} , {t('category.datasources', { ns: 'plugin' })} , {t('category.triggers', { ns: 'plugin' })} , {t('category.agents', { ns: 'plugin' })} , {t('category.extensions', { ns: 'plugin' })} {t('marketplace.and', { ns: 'plugin' })} {t('category.bundles', { ns: 'plugin' })} {t('operation.in', { ns: 'common' })} {t('marketplace.difyMarketplace', { ns: 'plugin' })}
{ isLoading && page === 1 && (
) } { (!isLoading || page > 1) && ( ) }
) } export default Marketplace