From 237eead38cfdcea7930e885a2a6069c2a79a2e07 Mon Sep 17 00:00:00 2001 From: yessenia Date: Wed, 4 Mar 2026 17:44:18 +0800 Subject: [PATCH] feat: add localized empty text support to CollectionList component --- .../components/plugins/marketplace/list/collection-list.tsx | 4 +++- .../plugins/marketplace/list/list-with-collection.tsx | 3 +++ web/app/components/plugins/marketplace/list/template-card.tsx | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/app/components/plugins/marketplace/list/collection-list.tsx b/web/app/components/plugins/marketplace/list/collection-list.tsx index ea19ad44bb..8f5ad7b7f3 100644 --- a/web/app/components/plugins/marketplace/list/collection-list.tsx +++ b/web/app/components/plugins/marketplace/list/collection-list.tsx @@ -119,6 +119,7 @@ type CollectionListProps = { gridClassName?: string cardContainerClassName?: string emptyClassName?: string + emptyText?: string } function CollectionList({ @@ -131,6 +132,7 @@ function CollectionList({ gridClassName = GRID_CLASS, cardContainerClassName, emptyClassName, + emptyText, }: CollectionListProps) { const locale = useLocale() @@ -139,7 +141,7 @@ function CollectionList({ }) if (collectionsWithItems.length === 0) { - return + return } return ( diff --git a/web/app/components/plugins/marketplace/list/list-with-collection.tsx b/web/app/components/plugins/marketplace/list/list-with-collection.tsx index 49c13146e3..dfa3a51819 100644 --- a/web/app/components/plugins/marketplace/list/list-with-collection.tsx +++ b/web/app/components/plugins/marketplace/list/list-with-collection.tsx @@ -2,6 +2,7 @@ import type { PluginCollection, Template, TemplateCollection } from '../types' import type { Plugin } from '@/app/components/plugins/types' +import { useTranslation } from '#i18n' import CardWrapper from './card-wrapper' import { CAROUSEL_COLLECTION_NAMES } from './collection-constants' import CollectionList from './collection-list' @@ -29,6 +30,7 @@ type ListWithCollectionProps = PluginsVariant | TemplatesVariant const ListWithCollection = (props: ListWithCollectionProps) => { const { variant, cardContainerClassName } = props + const { t } = useTranslation() if (variant === 'plugins') { const { @@ -76,6 +78,7 @@ const ListWithCollection = (props: ListWithCollectionProps) => { renderCard={renderTemplateCard} carouselCollectionNames={[CAROUSEL_COLLECTION_NAMES.featured]} cardContainerClassName={cardContainerClassName} + emptyText={t('marketplace.noTemplateFound', { ns: 'plugin' })} /> ) } diff --git a/web/app/components/plugins/marketplace/list/template-card.tsx b/web/app/components/plugins/marketplace/list/template-card.tsx index da3a4956cf..da651b56e4 100644 --- a/web/app/components/plugins/marketplace/list/template-card.tsx +++ b/web/app/components/plugins/marketplace/list/template-card.tsx @@ -75,8 +75,6 @@ const TemplateCardComponent = ({