2021-04-20 17:17:19 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { lazy, Suspense } from '@wordpress/element';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { EmbeddedBodyProps } from '../embedded-body-layout/embedded-body-props';
|
2021-08-02 21:38:14 +00:00
|
|
|
import RecommendationsEligibilityWrapper from '../settings-recommendations/recommendations-eligibility-wrapper';
|
2021-04-20 17:17:19 +00:00
|
|
|
|
|
|
|
const PaymentRecommendationsChunk = lazy(
|
|
|
|
() =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "payment-recommendations" */ './payment-recommendations'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
export const PaymentRecommendations: React.FC< EmbeddedBodyProps > = ( {
|
|
|
|
page,
|
|
|
|
tab,
|
|
|
|
section,
|
|
|
|
} ) => {
|
|
|
|
if ( page === 'wc-settings' && tab === 'checkout' && ! section ) {
|
|
|
|
return (
|
2021-08-02 21:38:14 +00:00
|
|
|
<RecommendationsEligibilityWrapper>
|
|
|
|
<Suspense fallback={ null }>
|
|
|
|
<PaymentRecommendationsChunk />
|
|
|
|
</Suspense>
|
|
|
|
</RecommendationsEligibilityWrapper>
|
2021-04-20 17:17:19 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
};
|