@@ -384,6 +384,23 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
384384 const [ exportModalStatus , setExportModalStatus ] = useState < ExportType | null > ( null ) ;
385385 const { showConfirmModal} = useConfirmModal ( ) ;
386386 const { showDecisionModal} = useDecisionModal ( ) ;
387+
388+ const showOfflineModal = ( ) => {
389+ showDecisionModal ( {
390+ title : translate ( 'common.youAppearToBeOffline' ) ,
391+ prompt : translate ( 'common.offlinePrompt' ) ,
392+ secondOptionText : translate ( 'common.buttonConfirm' ) ,
393+ } ) ;
394+ } ;
395+
396+ const showDownloadErrorModal = ( ) => {
397+ showDecisionModal ( {
398+ title : translate ( 'common.downloadFailedTitle' ) ,
399+ prompt : translate ( 'common.downloadFailedDescription' ) ,
400+ secondOptionText : translate ( 'common.buttonConfirm' ) ,
401+ } ) ;
402+ } ;
403+
387404 const { isPaidAnimationRunning, isApprovedAnimationRunning, isSubmittingAnimationRunning, startAnimation, stopAnimation, startApprovedAnimation, startSubmittingAnimation} =
388405 usePaymentAnimations ( ) ;
389406 const styles = useThemeStyles ( ) ;
@@ -585,20 +602,8 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
585602 reportActions,
586603 allTransactionsLength : transactions . length ,
587604 session,
588- onExportFailed : ( ) => {
589- showDecisionModal ( {
590- title : translate ( 'common.downloadFailedTitle' ) ,
591- prompt : translate ( 'common.downloadFailedDescription' ) ,
592- secondOptionText : translate ( 'common.buttonConfirm' ) ,
593- } ) ;
594- } ,
595- onExportOffline : ( ) => {
596- showDecisionModal ( {
597- title : translate ( 'common.youAppearToBeOffline' ) ,
598- prompt : translate ( 'common.offlinePrompt' ) ,
599- secondOptionText : translate ( 'common.buttonConfirm' ) ,
600- } ) ;
601- } ,
605+ onExportFailed : showDownloadErrorModal ,
606+ onExportOffline : showOfflineModal ,
602607 policy,
603608 beginExportWithTemplate : ( templateName , templateType , transactionIDList , policyID ) => beginExportWithTemplate ( templateName , templateType , transactionIDList , policyID ) ,
604609 isOnSearch,
0 commit comments