import type { RefObject } from 'react' import type { PluginDetail } from '../types' import type { PluginPageContentInset } from './content-inset' import type { Collection } from '@/app/components/tools/types' import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { ScrollAreaContent, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, } from '@langgenius/dify-ui/scroll-area' import { useTranslation } from 'react-i18next' import Loading from '@/app/components/base/loading' import { useToolMarketplacePanel } from '@/app/components/integrations/hooks/use-tool-marketplace-panel' import IntegrationsToolProviderCard from '@/app/components/integrations/tool-provider-card' import Marketplace from '@/app/components/tools/marketplace' import List from './list' type BuiltinMarketplacePanelProps = { containerRef: RefObject contentInset: PluginPageContentInset keywords: string tagFilterValue: string[] } const BuiltinMarketplacePanel = ({ containerRef, contentInset, keywords, tagFilterValue, }: BuiltinMarketplacePanelProps) => { const { isMarketplaceArrowVisible, marketplaceContext, showMarketplacePanel, toolListTailRef, } = useToolMarketplacePanel({ containerRef, keywords, tagFilterValue, }) return ( <>
) } type PluginsPanelResultsProps = { containerRef: RefObject contentFrameClassName: string contentInset: PluginPageContentInset currentBuiltinToolID?: string filteredBuiltinTools: Collection[] filteredList: Array hasToolMarketplacePanel: boolean hasVisibleBuiltinTools: boolean hasVisiblePlugins: boolean isAgentStrategyIntegrationPage: boolean isFetching: boolean isLastPage: boolean keywords: string loadNextPage: () => void scrollAreaLabel?: string setCurrentBuiltinToolID: (id: string) => void tagFilterValue: string[] } const PluginsPanelResults = ({ containerRef, contentFrameClassName, contentInset, currentBuiltinToolID, filteredBuiltinTools, filteredList, hasToolMarketplacePanel, hasVisibleBuiltinTools, hasVisiblePlugins, isAgentStrategyIntegrationPage, isFetching, isLastPage, keywords, loadNextPage, scrollAreaLabel, setCurrentBuiltinToolID, tagFilterValue, }: PluginsPanelResultsProps) => { const { t } = useTranslation() return ( {(hasVisiblePlugins || hasVisibleBuiltinTools) && ( {filteredBuiltinTools.map(collection => ( ))} )} {!isLastPage && (
{isFetching ? : ( )}
)} {hasToolMarketplacePanel && ( )}
) } export default PluginsPanelResults