/** * External dependencies */ import { Guide } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { createInterpolateElement } from '@wordpress/element'; import { isWpVersion } from '@woocommerce/settings'; import type { ReactElement } from 'react'; /** * Internal dependencies */ import { useCompatibilityNotice } from './use-compatibility-notice'; import WooImage from './woo-image'; interface CartCheckoutCompatibilityNoticeProps { blockName: 'cart' | 'checkout' | 'mini-cart'; } export function CartCheckoutCompatibilityNotice( { blockName, }: CartCheckoutCompatibilityNoticeProps ): ReactElement | null { const [ isVisible, dismissNotice ] = useCompatibilityNotice( blockName ); if ( isWpVersion( '5.4', '<=' ) || ! isVisible ) { return null; } return ( dismissNotice() } finishButtonText={ __( 'Got it!', 'woo-gutenberg-products-block' ) } pages={ [ { image: , content: ( <>

{ __( 'Compatibility notice', 'woo-gutenberg-products-block' ) }

{ createInterpolateElement( __( 'This block may not be compatible with all checkout extensions and integrations.', 'woo-gutenberg-products-block' ), { em: , } ) }

{ createInterpolateElement( __( 'We recommend reviewing our expanding list of compatible extensions prior to using this block on a live store.', 'woo-gutenberg-products-block' ), { a: ( // eslint-disable-next-line jsx-a11y/anchor-has-content ), } ) }

), }, ] } /> ); }