import { ChoiceBox } from '@auto-launch/components/ChoiceBox'; import { buildExtendifyCodeLink } from '@auto-launch/functions/extendify-code'; import { checkIn } from '@auto-launch/functions/insights'; import { useLaunchDataStore } from '@auto-launch/state/launch-data'; import { useEffect } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { arrowRight, code, external, layout } from '@wordpress/icons'; import { motion } from 'framer-motion'; export const ExtendifyCodeConnector = ({ onProceed }) => { const { descriptionRaw, title } = useLaunchDataStore(); const { extendifyCodeData = {} } = window.extSharedData; const { link, title: codeTitle, message, ctaPrimary } = extendifyCodeData; const hasCodeConnectorData = link && codeTitle && message && ctaPrimary; useEffect(() => { if (!hasCodeConnectorData) { onProceed(); return; } checkIn({ stage: 'extendify_code_screen_seen', description: descriptionRaw || title, }); }, [hasCodeConnectorData, onProceed, descriptionRaw, title]); if (!hasCodeConnectorData) return null; const goToWordPress = () => { checkIn({ stage: 'extendify_code_choose_wordpress' }); onProceed(); }; const goToBuilder = () => { const url = buildExtendifyCodeLink(link, { description: descriptionRaw, title, }); checkIn({ stage: 'extendify_code_choose_builder' }); if (url) window.location.assign(url); }; return (

{__('How would you like to build this?', 'extendify-local')}

{__( 'Based on what you described, your site may need some advanced functionality.', 'extendify-local', )}

); };