import { HeroSection } from "./HeroSection";
import { BookingForm } from "./BookingForm";
import { VehiclesStep } from "./VehiclesStep";
import { ConfirmationStep } from "./ConfirmationStep";
import { SuccessStep } from "./SuccessStep";
import { FeaturesSection } from "./FeaturesSection";
import { ServicesSection } from "./ServicesSection";
import { BookingStep, BookingData, Vehicle } from "../types/booking";

interface BookingStepRendererProps {
  currentStep: BookingStep;
  bookingData: BookingData | null;
  selectedVehicle: Vehicle | null;
  availableVehicles: Vehicle[];
  onSubmit: (data: BookingData) => void;
  onVehicleSelect: (vehicle: Vehicle) => void;
  onConfirm: () => void;
  onBackToForm: () => void;
  onBackToVehicles: () => void;
}

export function BookingStepRenderer({
  currentStep,
  bookingData,
  selectedVehicle,
  availableVehicles,
  onSubmit,
  onVehicleSelect,
  onConfirm,
  onBackToForm,
  onBackToVehicles
}: BookingStepRendererProps) {
  switch (currentStep) {
    case "form":
      return (
        <>
          <HeroSection>
            <BookingForm onSubmit={onSubmit} />
          </HeroSection>
          <FeaturesSection />
          <ServicesSection />
        </>
      );
    
    case "vehicles":
      return (
        <VehiclesStep
          availableVehicles={availableVehicles}
          bookingData={bookingData!}
          onVehicleSelect={onVehicleSelect}
          onBack={onBackToForm}
        />
      );
    
    case "confirmation":
      return (
        <ConfirmationStep
          bookingData={bookingData!}
          selectedVehicle={selectedVehicle!}
          onConfirm={onConfirm}
          onEdit={onBackToForm}
          onBack={onBackToVehicles}
        />
      );
    
    case "success":
      return (
        <SuccessStep
          selectedVehicle={selectedVehicle!}
          onBookAnother={onBackToForm}
        />
      );
    
    default:
      return null;
  }
}