woocommerce-paypal-payments/modules/ppcp-paylater-block/resources/js/components/preview-placeholder.js
Narek Zakarian 7064ce9c65
feat(ppcp-paylater-block): add PreviewPlaceholder component
Shared component that renders a Spinner while the preview is loading
and a static text placeholder once the timeout elapses, replacing
the duplicated inline conditional across all three block editors.
2026-05-05 17:07:03 +04:00

16 lines
446 B
JavaScript

import { __ } from '@wordpress/i18n';
import { Spinner } from '@wordpress/components';
export function PreviewPlaceholder( { timedOut } ) {
if ( ! timedOut ) {
return <Spinner />;
}
return (
<p className="ppcp-paylater-preview-placeholder">
{ __(
'Pay Later messaging preview unavailable in editor. Messaging will display on the frontend when eligibility conditions are met.',
'woocommerce-paypal-payments'
) }
</p>
);
}