import { __ } from '@wordpress/i18n'; import { Button, Modal, Spinner } from '@wordpress/components'; import Message from './Message'; type LianaMigrationModalProps = { data: object; dataIsLoading: boolean; isOpen: boolean; loading: boolean; onClose: () => void; onMigrate: () => void; }; const dismissModal = ( onClose ) => { localStorage.setItem( 'gs_migration_modal_dismissed', '1' ); onClose(); }; const getPluginsAsListItems = ( data ) => { if ( ! data || ! data.plugins ) { return null; } const plugins = data.plugins.automation.concat( data.plugins.mailer ); return plugins.map( ( pluginName, index ) => (
  • { pluginName }
  • ) ); }; export default function LianaMigrationModal( props: LianaMigrationModalProps ) { const { data = {}, dataIsLoading, isOpen, loading, onClose, onMigrate, } = props; const modalContent = isOpen ? ( <>

    { __( 'The following plugins were detected on your site. We can automatically import settings and deactivate them to avoid conflicts.', 'liana-with-growthstack' ) }

    ) : null; return ( <> { isOpen && ( dismissModal( onClose ) } style={ { width: '100%', maxWidth: '920px', } } > { dataIsLoading && } { ! dataIsLoading && ( ) }
    ) } ); }