import { Button, ExternalLink, __experimentalHStack as HStack } from '@wordpress/components'; // eslint-disable-line @wordpress/no-unsafe-wp-apis
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import IntegrationCard from '../../blocks/contact-form/components/jetpack-integrations-modal/integration-card';
import MailPoetIcon from '../../icons/mailpoet';
import type { SingleIntegrationCardProps, IntegrationCardData } from '../../types';
const MailPoetDashboardCard = ( {
isExpanded,
onToggle,
data,
refreshStatus,
}: SingleIntegrationCardProps ) => {
const { isConnected: mailpoetActiveWithKey = false, settingsUrl = '' } = data || {};
const cardData: IntegrationCardData = {
...data,
showHeaderToggle: false,
isLoading: ! data || typeof data.isInstalled === 'undefined',
refreshStatus,
trackEventName: 'jetpack_forms_upsell_mailpoet_click',
notInstalledMessage: createInterpolateElement(
__(
'Add powerful email marketing to your forms with MailPoet. Simply install the plugin to start sending emails.',
'jetpack-forms'
),
{
a:
{ createInterpolateElement(
__(
'MailPoet is active. There is one step left. Please add your MailPoet key.',
'jetpack-forms'
),
{
a:
{ __( 'You can now send marketing emails with MailPoet.', 'jetpack-forms' ) }