'use client'; import { useCallback } from 'react'; import clsx from 'clsx'; import PluginModule, { Component } from '@akinon/next/components/plugin-module'; import { CheckoutPiece } from '@akinon/pz-theme/src/chrome/checkout-piece'; import ContactSection from '../one-page/sections/contact-section'; import AddressSection from '../one-page/sections/address-section'; import ShippingSection from '../one-page/sections/shipping-section'; import PaymentSection from '../one-page/sections/payment-section'; import OnePageSummary from '../one-page/one-page-summary'; import MobileSummarySheet from '../one-page/mobile-summary-sheet'; import TrustBadges from '../one-page/trust-badges'; import { useSectionState, type SectionId } from '../one-page/hooks/use-section-state'; import { useCheckoutFunnelGtm } from '../one-page/hooks/use-checkout-funnel-gtm'; import BasketSection from './basket-section'; import type { CheckoutVariantProps } from '../types'; const BasketAndCheckout = ({ options }: CheckoutVariantProps) => { const autoAdvance = options?.autoAdvance ?? true; const stickyMobileCta = options?.stickyMobileCta ?? true; const enableEditMode = options?.enableEditMode ?? true; const showOrderReview = options?.showOrderReview ?? true; const showTrustBadges = options?.showTrustBadges ?? true; const gtmEnabled = options?.gtmEnabled ?? true; const compactMode = options?.compactMode ?? false; const { sections, activeSection, openSection } = useSectionState({ autoAdvance }); useCheckoutFunnelGtm(activeSection, { enabled: gtmEnabled }); const sectionStatus = useCallback( (id: SectionId) => sections.find((section) => section.id === id)?.status ?? 'locked', [sections] ); const goTo = useCallback( (id: SectionId) => () => openSection(id), [openSection] ); return (
{showTrustBadges && }
{stickyMobileCta && (
)}
); }; export default BasketAndCheckout;