import {
  AncillaryStepEnum,
  useAddAncillaryStore,
} from "@/stores/my-stay/add-ancillary-flow"

import ConfirmationStep from "../ConfirmationStep"
import DeliveryMethodStep from "../DeliveryDetailsStep"
import SelectAncillaryStep from "../SelectAncillaryStep"
import SelectQuantityStep from "../SelectQuantityStep"

import type { StepsProps } from "@/types/components/myPages/myStay/ancillaries"

export default function Desktop({ user, savedCreditCards }: StepsProps) {
  const currentStep = useAddAncillaryStore((state) => state.currentStep)
  if (currentStep === AncillaryStepEnum.selectAncillary) {
    return <SelectAncillaryStep />
  }
  if (currentStep === AncillaryStepEnum.selectQuantity) {
    return <SelectQuantityStep user={user} />
  }
  if (currentStep === AncillaryStepEnum.selectDelivery) {
    return <DeliveryMethodStep />
  }

  return <ConfirmationStep savedCreditCards={savedCreditCards} user={user} />
}
