diff --git a/src/components/Search/SearchActionOptionsUtils.tsx b/src/components/Search/SearchActionOptionsUtils.tsx deleted file mode 100644 index 20601abd3696..000000000000 --- a/src/components/Search/SearchActionOptionsUtils.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; -import * as Expensicons from '@components/Icon/Expensicons'; -import CONST from '@src/CONST'; -import type {SearchHeaderOptionValue} from './SearchPageHeader'; - -function getDownloadOption(text: string, onSelected?: () => void): DropdownOption { - return { - icon: Expensicons.Download, - text, - value: CONST.SEARCH.BULK_ACTION_TYPES.EXPORT, - shouldCloseModalOnSelect: true, - onSelected, - }; -} - -export default getDownloadOption; diff --git a/src/components/Search/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader.tsx index 357b71f4a2f3..0e49ca1401b9 100644 --- a/src/components/Search/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader.tsx @@ -19,7 +19,6 @@ import ROUTES from '@src/ROUTES'; import type {SearchReport} from '@src/types/onyx/SearchResults'; import type DeepValueOf from '@src/types/utils/DeepValueOf'; import type IconAsset from '@src/types/utils/IconAsset'; -import getDownloadOption from './SearchActionOptionsUtils'; import {useSearchContext} from './SearchContext'; import type {SearchStatus, SelectedTransactions} from './types'; @@ -74,22 +73,23 @@ function SearchPageHeader({ const options: Array> = []; - // Because of some problems with the lib we use for download on native we are only enabling download for web, we should remove the SearchActionOptionsUtils files when https://github.com/Expensify/App/issues/45511 is done - const downloadOption = getDownloadOption(translate('common.download'), () => { - if (isOffline) { - setOfflineModalOpen?.(); - return; - } - - SearchActions.exportSearchItemsToCSV(status, selectedReports, selectedTransactionsKeys, [activeWorkspaceID ?? ''], () => { - setDownloadErrorModalOpen?.(); - }); + options.push({ + icon: Expensicons.Download, + text: translate('common.download'), + value: CONST.SEARCH.BULK_ACTION_TYPES.EXPORT, + shouldCloseModalOnSelect: true, + onSelected: () => { + if (isOffline) { + setOfflineModalOpen?.(); + return; + } + + SearchActions.exportSearchItemsToCSV(status, selectedReports, selectedTransactionsKeys, [activeWorkspaceID ?? ''], () => { + setDownloadErrorModalOpen?.(); + }); + }, }); - if (downloadOption) { - options.push(downloadOption); - } - const shouldShowHoldOption = !isOffline && selectedTransactionsKeys.every((id) => selectedTransactions[id].canHold); if (shouldShowHoldOption) {