From b2df7aca3e15567fca510049a188ff90ef0fb51f Mon Sep 17 00:00:00 2001 From: tusmester Date: Thu, 4 Jan 2024 14:15:18 +0100 Subject: [PATCH] Add limit info to search result text. --- apps/sensenet/src/components/search/search-results.tsx | 7 ++++++- apps/sensenet/src/localization/default.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/sensenet/src/components/search/search-results.tsx b/apps/sensenet/src/components/search/search-results.tsx index f26e4b1fc..3296cc8b8 100644 --- a/apps/sensenet/src/components/search/search-results.tsx +++ b/apps/sensenet/src/components/search/search-results.tsx @@ -25,6 +25,11 @@ export const SearchResults = () => { const snRoute = useSnRoute() const searchState = useSearch() + const maxResultCount = 20 + + const resultText = + localization.resultCount(searchState.resultCount) + + (searchState.resultCount > maxResultCount ? ` ${localization.resultLimited(maxResultCount)}` : '') return ( <> @@ -36,7 +41,7 @@ export const SearchResults = () => { {searchState.isLoading && } - {localization.resultCount(searchState.resultCount)} + {resultText} diff --git a/apps/sensenet/src/localization/default.ts b/apps/sensenet/src/localization/default.ts index e169886d2..95bf39038 100644 --- a/apps/sensenet/src/localization/default.ts +++ b/apps/sensenet/src/localization/default.ts @@ -383,6 +383,7 @@ const values = { queryHelperText: 'Enter a keyword', clearTerm: 'Clear input', resultCount: (count: number) => `${count} results`, + resultLimited: (limit: number) => `(only the first ${limit} are displayed)`, openInSearchTitle: (term: string) => `See all results for '${term}'`, openInSearchDescription: 'Opens the query expression in the Search view', saveQuery: 'Save Query',