diff --git a/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx b/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx index 9a0936ee2856..74342bdf5f34 100644 --- a/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx +++ b/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx @@ -38,10 +38,6 @@ function RequireQuickBooksDesktopModal({route}: RequireQuickBooksDesktopModalPro const [codatSetupLink, setCodatSetupLink] = useState(''); const hasResultOfFetchingSetupLink = !!codatSetupLink || hasError; - const ContentWrapper = hasResultOfFetchingSetupLink - ? ({children}: React.PropsWithChildren) => children - : ({children}: React.PropsWithChildren) => {children}; - const fetchSetupLink = useCallback(() => { setHasError(false); // eslint-disable-next-line rulesdir/no-thenable-actions-in-views @@ -79,6 +75,56 @@ function RequireQuickBooksDesktopModal({route}: RequireQuickBooksDesktopModalPro const shouldShowError = hasError; + const children = ( + <> + {shouldShowError && ( + + + {translate('workspace.qbd.setupPage.setupErrorTitle')} + + + + + )} + {!shouldShowError && ( + + + + + + {translate('workspace.qbd.setupPage.title')} + {translate('workspace.qbd.setupPage.body')} + + {!hasResultOfFetchingSetupLink ? ( + + ) : ( + + )} + + +