'use client'; import { Check } from 'lucide-react'; import { useEffect, useRef } from 'react'; // Shared source of truth for the booking flow's step order/labels — also // consumed by AppSidebar's vertical step list on desktop. export const BOOKING_STEPS = [ { id: 'search', name: 'Search' }, { id: 'results', name: 'Results' }, { id: 'passengers', name: 'Passengers' }, { id: 'seats', name: 'Seats' }, { id: 'review', name: 'Review' }, { id: 'payment', name: 'Payment' }, { id: 'confirmation', name: 'Done' }, ]; const steps = BOOKING_STEPS; export function ProgressIndicator({ currentStep }: { currentStep: string }) { const currentIndex = steps.findIndex((s) => s.id === currentStep); const scrollRef = useRef(null); const activeRef = useRef(null); // Auto-scroll active step to centre on mobile useEffect(() => { const container = scrollRef.current; const active = activeRef.current; if (!container || !active) return; const offset = active.offsetLeft + active.offsetWidth / 2 - container.clientWidth / 2; container.scrollTo({ left: offset, behavior: 'smooth' }); }, [currentIndex]); const stepItem = (step: typeof steps[0], index: number) => { const isComplete = index < currentIndex; const isCurrent = index === currentIndex; return (
  • {/* Line + Circle row */}
    {/* Left connector */}
    {/* Circle */}
    {isComplete ? : {index + 1} }
    {/* Right connector */}
    {/* Label */}

    {step.name}

  • ); }; // Desktop shows the vertical step list embedded in AppSidebar instead — // this component is mobile-only now (the sidebar doesn't exist below lg). return ( ); }