/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import AppButton from '~/components/app-button';
import StepContent from '~/components/stepper/step-content';
import StepContentHeader from '~/components/stepper/step-content-header';
import StepContentActions from '~/components/stepper/step-content-actions';
import StepContentFooter from '~/components/stepper/step-content-footer';
import { ConnectedGoogleAccountCard } from '~/components/google-account-card';
import GoogleAdsAccountCard from '~/components/google-ads-account-card';
import useGoogleAdsAccount from '~/hooks/useGoogleAdsAccount';
import useGoogleAccount from '~/hooks/useGoogleAccount';
import AppSpinner from '~/components/app-spinner';
import Section from '~/components/section';
import useGoogleAdsAccountReady from '~/hooks/useGoogleAdsAccountReady';
const SetupAccounts = ( props ) => {
const { onContinue = () => {} } = props;
const { google } = useGoogleAccount();
const { googleAdsAccount } = useGoogleAdsAccount();
const { isLinkedToMerchantCenter } = useGoogleAdsAccountReady();
if ( ! google || ( google.active === 'yes' && ! googleAdsAccount ) ) {
return ;
}
/**
* Here it uses `isLinkedToMerchantCenter` rather than `isGoogleAdsReady`
* state because the latter is still true when the linking process fails.
* When `isLinkedToMerchantCenter` is true, it already means the connection
* process of Ads account is completed.
*/
const isContinueButtonDisabled = ! isLinkedToMerchantCenter;
return (
{ __( 'Continue', 'google-listings-and-ads' ) }
);
};
export default SetupAccounts;