import { __ } from '@wordpress/i18n' import classNames from 'classnames' import { CustomScroll } from 'react-custom-scroll' import { Button } from '../../../components/Button/Button' import { useBookingContext } from '../../../providers/BookingFormProvider/BookingFormProvider' import { ReactComponent as CheckIcon } from '../../../../../public/images/icon-checkmark.svg' import { useWording } from '../../../hooks/useWording' import { usePackagePurchase } from '../PackagePurchaseContext' import '../../BookingForm/steps/Steps.scss' import '../../../components/Services/Services.scss' export const PackageSelectStep = () => { const { products, selectedProductId, selectProduct } = usePackagePurchase() const { disableCustomScroll, preset } = useBookingContext() const wording = useWording() const hidePrices = preset?.settings?.show_prices === false const content = (
{products.length === 0 && (

{__( 'No packages are available for purchase.', 'webba-booking-lite' )}

)} {products.map((product) => { const selected = selectedProductId === product.id return (
selectProduct(selected ? null : product.id) } >

{product.name}

{product.visit_count}{' '} {__( 'visits', 'webba-booking-lite' )}

{!hidePrices && (
{product.price_formatted}
)}
{product.description ? (

) : null} {(product.min_interval_days > 0 || product.max_visits_per_week > 0 || product.max_visits_per_month > 0 || product.max_visits_per_day > 0) && (

{product.min_interval_days > 0 && ( {__( 'Min days between visits:', 'webba-booking-lite' )}{' '} {product.min_interval_days} {' · '} )} {product.max_visits_per_week > 0 && ( {__( 'Max / week:', 'webba-booking-lite' )}{' '} { product.max_visits_per_week } {' · '} )} {product.max_visits_per_month > 0 && ( {__( 'Max / month:', 'webba-booking-lite' )}{' '} { product.max_visits_per_month } )}

)}
) })}
) return disableCustomScroll ? (
{content}
) : ( {content} ) }