import { DialogTitle } from '@headlessui/react'; import { Spinner } from '@wordpress/components'; import { __, _n } from '@wordpress/i18n'; import { check, Icon } from '@wordpress/icons'; import { ACCOUNT_STATUS } from './usePluginsActivation'; const SuccessIcon = () => (
); const isPending = (plugin) => plugin.status === ACCOUNT_STATUS.pending; export const SetupComplete = ({ plugins, handleClose }) => { const isRunning = plugins.some(isPending); const accountCount = plugins.length; const heading = isRunning ? _n( 'Setting up your plugin account', 'Setting up your plugin accounts', accountCount, 'extendify-local', ) : __('Setup complete', 'extendify-local'); const body = isRunning ? _n( 'You can close this window. We will finish creating your account in the background.', 'You can close this window. We will finish creating your accounts in the background.', accountCount, 'extendify-local', ) : _n( 'Your plugin account has been set up. Account activation may take a moment to complete.', 'Your plugin accounts have been set up. Account activation may take a moment to complete.', accountCount, 'extendify-local', ); return (
{isRunning ? ( ) : ( )}
{heading}

{body}

{plugins.map((plugin) => (
{plugin.title} {isPending(plugin) ? ( ) : ( )}
))}
); };