£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyʦ•ꎅȮFÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~芩ÊÇí`ÔÑ©ú뙵'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ӽ㞪éUWŸÈË%DÒÕ¬ï‘]/Åcx ‰ï2ß]ä6G[]S£Ôϯrs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
import { useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import classNames from 'classnames';
import { useUserSelectionStore } from '@launch//state/user-selections';
import { Title } from '@launch/components/Title';
import { PageLayout } from '@launch/layouts/PageLayout';
import { usePagesStore } from '@launch/state/Pages';
import { pageState } from '@launch/state/factory';
import {
Blog,
Business,
ECommerce,
LandingPage,
OtherSiteTypes,
} from '@launch/svg';
export const state = pageState('Website Objective', () => ({
ready: false,
canSkip: false,
useNav: true,
onRemove: () => {},
}));
const sections = [
{
title: __('Business', 'extendify-local'),
slug: 'business',
icon: ,
},
{
title: __('eCommerce', 'extendify-local'),
slug: 'ecommerce',
icon: ,
},
{
title: __('Blog', 'extendify-local'),
slug: 'blog',
icon: ,
},
{
title: __('Landing Page', 'extendify-local'),
slug: 'landing-page',
icon: ,
},
{
title: __('Other', 'extendify-local'),
slug: 'other',
icon: ,
},
];
export const ObjectiveSelection = () => {
const { siteObjective, siteStructure, setSiteObjective, setSiteStructure } =
useUserSelectionStore();
const { nextPage } = usePagesStore();
const handleClick = (slug) => {
setSiteObjective(slug);
// Add a small delay before page transition to ensure state updates
// (particularly siteStructure) are fully processed and synchronized
// before navigating to the next step in the site creation flow.
setTimeout(nextPage, 5);
};
useEffect(() => {
if (siteObjective === 'landing-page') {
setSiteStructure('single-page');
}
}, [siteObjective, setSiteStructure, siteStructure]);
useEffect(() => {
state.setState({ ready: !!siteObjective });
}, [siteObjective]);
return (
{sections.map(({ icon, slug, title }) => (
handleClick(slug)}
selected={siteObjective === slug}
/>
))}
);
};
const ButtonSelect = ({ title, onClick, selected, icon, slug }) => (
{
if (!['Enter', 'Space', ' '].includes(e.key)) return;
e.preventDefault();
onClick();
}}
onClick={onClick}>
);