import { useEffect, useCallback } from '@wordpress/element'; import { useHistory } from 'react-router-dom'; import { __ } from '@wordpress/i18n'; import { useStateValue } from '../utils/StateProvider'; // import CartFlowsLogo from '@WizardImages/cartflows-logo.svg'; import { ArrowRightIcon } from '@heroicons/react/24/outline'; function WelcomeStep() { const history = useHistory(); const [ { action_button }, dispatch ] = useStateValue(); const redirectNextStep = useCallback( () => { history.push( { pathname: 'index.php', search: `?page=cartflow-setup&step=page-builder`, } ); }, [] ); useEffect( () => { dispatch( { status: 'SET_NEXT_STEP', action_button: { button_text: __( "Let's Start", 'cartflows' ), button_class: 'wcf-start-setup', }, } ); const startOnboardingEvent = function () { redirectNextStep(); }; document.addEventListener( 'wcf-redirect-page-builder-step', startOnboardingEvent, false ); return () => { document.removeEventListener( 'wcf-redirect-page-builder-step', startOnboardingEvent ); }; }, [ redirectNextStep ] ); return (
{ __( 'Step 1 of 6', 'cartflows' ) }

{ __( 'Welcome to CartFlows', 'cartflows' ) }

{ __( "You're only minutes away from having a more profitable WooCommerce store! This short setup wizard will help you get started with CartFlows.", 'cartflows' ) }

{ action_button.button_text }
); } export default WelcomeStep;