/** * External dependencies */ import { Button, Modal } from '@wordpress/components'; import { Sender } from 'xstate'; import { __ } from '@wordpress/i18n'; import { Link } from '@woocommerce/components'; import { createInterpolateElement } from '@wordpress/element'; /** * Internal dependencies */ import { customizeStoreStateMachineEvents } from '..'; import { ADMIN_URL } from '~/utils/admin-settings'; import { trackEvent } from '../tracking'; export const DesignChangeWarningModal = ( { setOpenDesignChangeWarningModal, sendEvent, classname = 'woocommerce-customize-store__design-change-warning-modal', }: { setOpenDesignChangeWarningModal: ( arg0: boolean ) => void; sendEvent: Sender< customizeStoreStateMachineEvents >; classname?: string; } ) => { return ( setOpenDesignChangeWarningModal( false ) } shouldCloseOnClickOutside={ false } >

{ createInterpolateElement( __( "The Store Designer will create a new store design for you, and you'll lose any changes you've made to your active theme. If you'd prefer to continue editing your theme, you can do so via the Editor.", 'woocommerce' ), { EditorLink: ( { window.open( `${ ADMIN_URL }site-editor.php`, '_blank' ); return false; } } href="" /> ), } ) }

); }; export const StartNewDesignWarningModal = ( { setOpenDesignChangeWarningModal, sendEvent, classname = 'woocommerce-customize-store__design-change-warning-modal', }: { setOpenDesignChangeWarningModal: ( arg0: boolean ) => void; sendEvent: Sender< customizeStoreStateMachineEvents >; classname?: string; } ) => { return ( setOpenDesignChangeWarningModal( false ) } shouldCloseOnClickOutside={ false } >

{ createInterpolateElement( __( "The Store Designer will create a new store design for you, and you'll lose any changes you've made to your active theme. If you'd prefer to continue editing your theme, you can do so via the Editor.", 'woocommerce' ), { EditorLink: ( { window.open( `${ ADMIN_URL }site-editor.php`, '_blank' ); return false; } } href="" /> ), } ) }

); }; export const StartOverWarningModal = ( { setOpenDesignChangeWarningModal, sendEvent, classname = 'woocommerce-customize-store__design-change-warning-modal', }: { setOpenDesignChangeWarningModal: ( arg0: boolean ) => void; sendEvent: Sender< customizeStoreStateMachineEvents >; classname?: string; } ) => { return ( setOpenDesignChangeWarningModal( false ) } shouldCloseOnClickOutside={ false } >

{ createInterpolateElement( __( "You'll be asked to provide your business info again, and will lose your existing AI design. If you want to customize your existing design, you can do so via the Editor.", 'woocommerce' ), { EditorLink: ( { window.open( `${ ADMIN_URL }site-editor.php`, '_blank' ); return false; } } href="" /> ), } ) }

); }; export const ThemeSwitchWarningModal = ( { isNoAiFlow = true, setIsModalOpen, redirectToCYSFlow, }: { isNoAiFlow?: boolean; setIsModalOpen: ( arg0: boolean ) => void; redirectToCYSFlow: () => void; } ) => { return ( setIsModalOpen( false ) } shouldCloseOnClickOutside={ false } >

{ isNoAiFlow ? __( 'Your active theme will be changed and you could lose any changes you’ve made to it.', 'woocommerce' ) : createInterpolateElement( __( "The Store Designer will create a new store design for you, and you'll lose any changes you've made to your active theme. If you'd prefer to continue editing your theme, you can do so via the Editor.", 'woocommerce' ), { EditorLink: ( { window.open( `${ ADMIN_URL }site-editor.php`, '_blank' ); return false; } } href="" /> ), } ) }

); };