From 3c2a24d6f058fb341caa9e4ad7564209949f1133 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:42:13 +0100 Subject: [PATCH] added header message to custom close date selection list --- .../CustomCloseDateSelectionList.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/CustomCloseDateSelectionList.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/CustomCloseDateSelectionList.tsx index f8380d423d5f..9a26390b97c8 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/CustomCloseDateSelectionList.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/CustomCloseDateSelectionList.tsx @@ -25,7 +25,7 @@ function CustomCloseDateSelectionList({initiallySelectedDay, onConfirmSelectedDa const [searchValue, debouncedSearchValue, setSearchValue] = useDebouncedState(''); const [error, setError] = useState(undefined); - const sections = useMemo(() => { + const {sections, headerMessage} = useMemo(() => { const data = CONST.DATE.MONTH_DAYS.reduce((days, dayValue) => { const day = { value: dayValue, @@ -45,8 +45,11 @@ function CustomCloseDateSelectionList({initiallySelectedDay, onConfirmSelectedDa return days; }, []); - return [{data, indexOffset: 0}]; - }, [selectedDay, debouncedSearchValue]); + return { + sections: [{data, indexOffset: 0}], + headerMessage: data.length === 0 ? translate('common.noResultsFound') : undefined, + }; + }, [selectedDay, debouncedSearchValue, translate]); const selectDayAndClearError = useCallback((item: CustomCloseDateListItem) => { setSelectedDay(item.value); @@ -80,6 +83,7 @@ function CustomCloseDateSelectionList({initiallySelectedDay, onConfirmSelectedDa textInputLabel={translate('common.search')} textInputValue={searchValue} onChangeText={setSearchValue} + headerMessage={headerMessage} > {!!error && (