import { __ } from '@wordpress/i18n' import classNames from 'classnames' import { IWebba5StepHeaderProps, Webba5StepId } from './types' const STEPS: { id: Webba5StepId; label: string }[] = [ { id: 'service', label: __('Service', 'webba-booking-lite') }, { id: 'schedule', label: __('Schedule', 'webba-booking-lite') }, { id: 'details', label: __('Details', 'webba-booking-lite') }, { id: 'review', label: __('Review & Payment', 'webba-booking-lite') }, ] export const Webba5StepHeader = ({ currentStep, serviceStepLocked, canOpenSchedule, canOpenDetails, canOpenReview, onStep, }: IWebba5StepHeaderProps) => { const currentIndex = STEPS.findIndex((step) => step.id === currentStep) return (
    {STEPS.map((step, index) => { const isCurrent = step.id === currentStep const isComplete = index < currentIndex const canOpen = (step.id === 'service' && !serviceStepLocked) || (step.id === 'schedule' && canOpenSchedule) || (step.id === 'details' && canOpenDetails) || (step.id === 'review' && canOpenReview) return (
  1. ) })}
) }