import { useState } from 'react'; import { __ } from '@wordpress/i18n'; import { MailPoet } from '../../mailpoet'; export function BuildYourOwnSection(): JSX.Element { const [itemOpen, setItemOpen] = useState('start-with-a-trigger'); const list: { slug: string; title: string; text: string; image: string }[] = [ { slug: 'start-with-a-trigger', title: __('Start with a trigger', 'mailpoet'), text: __( 'Deliver relevant messages to your customers based on who they are and how they interact with your business.', 'mailpoet', ), image: `${MailPoet.cdnUrl}automation/sections/start-with-a-trigger.png`, }, { slug: 'customize-your-workflow', title: __('Customize your automation', 'mailpoet'), text: __( 'Choose steps and create a custom journey to best suit your needs.', 'mailpoet', ), image: `${MailPoet.cdnUrl}automation/sections/customize-your-workflow.png`, }, { slug: 'design-your-email', title: __('Design your email', 'mailpoet'), text: __( 'Modify one of our pre-made email templates or create your own design.', 'mailpoet', ), image: `${MailPoet.cdnUrl}automation/sections/design-your-email.png`, }, { slug: 'start-engaging', title: __('Start engaging', 'mailpoet'), text: __( 'Activate the automation and start engaging with your customers as they interact with your business.', 'mailpoet', ), image: `${MailPoet.cdnUrl}automation/sections/start-engaging.png`, }, ]; const selectedItem = list.filter((item) => item.slug === itemOpen)[0]; return (

{__('Build your own automations', 'mailpoet')}

{__( 'Create customized email sequences with our new automation editor.', 'mailpoet', )}

    {list.map((item, index) => (
  1. {index < 10 ? `0${index + 1}` : index + 1}

    {item.text}

  2. ))}
{selectedItem.title}
); }