import ButtonInput from "../Inputs/ButtonInput"; // @ts-ignore import Icon from '@/utils/Icon'; import { __ } from "@wordpress/i18n"; import useOnboardingStore from "../../store/useOnboardingStore"; import {get_website_url} from "../../utils/lib.js"; export const ModalFooter = ({ isContinueDisabled, validateAndContinue, currentStep, handleContinue, }) => { const { onboardingData, isUpdating, currentStepIndex, footerMessage, isLastStep, isInstalling, licenseStatus, } = useOnboardingStore(); const upgradeUrl = get_website_url(onboardingData.upgrade, { utm_source:onboardingData.prefix + '_onboarding', utm_content: 'upgrade' }); // Decide disabled state once to reuse below const continueDisabled = isContinueDisabled(); const isLicenseAndUpdating = currentStep?.type === 'license' && licenseStatus === 'activating' const isLicenseAndValid = currentStep?.type === 'license' && licenseStatus === 'activated' const allInstalled = onboardingData.is_all_plugins_installed; const isPluginStepAndAllInstalled = currentStep?.type === 'plugins' && allInstalled return (<> {currentStep.enable_premium_btn === true && !onboardingData.is_pro && (
{currentStep.premium_btn_text ? currentStep.premium_btn_text : __('Go Premium', 'ONBOARDING_WIZARD_TEXT_DOMAIN')}
)}
{(currentStepIndex > 0 && !isLastStep() && !isLicenseAndUpdating && !isLicenseAndValid && !isPluginStepAndAllInstalled) && (
handleContinue(e)} > {__('Skip this step', 'ONBOARDING_WIZARD_TEXT_DOMAIN')} {/* Skip Step Button Icon - Only render if the icon is provided */} {currentStep.skip_step && ( )}
)} {!isLicenseAndUpdating && currentStep.button && ( validateAndContinue(e)} key={currentStep.id + "continue"} > {/* Button label */} {isLicenseAndValid ? __('Continue', 'ONBOARDING_WIZARD_TEXT_DOMAIN') : currentStep.button.label} {/* Button Icon - Only render if icon is provided */} {currentStep.button.icon && ( )} )}
{currentStep.note && (

{currentStep.note}

)} {footerMessage && (
{footerMessage}
)} ); }