import type { z } from "zod"

import type { Room } from "@/types/stores/my-stay"
import type { CreditCard, User } from "@/types/user"
import type {
  ancillaryPackagesSchema,
  packagesSchema,
} from "@/server/routers/hotels/output"

export type Ancillaries = z.output<typeof ancillaryPackagesSchema>
export type Ancillary = Ancillaries[number]
export type SelectedAncillary = Ancillary["ancillaryContent"][number]
export type Packages = z.output<typeof packagesSchema>

export interface AncillariesProps {
  ancillariesPromise: Promise<Ancillaries | null>
  packages: Packages | null
  savedCreditCards: CreditCard[] | null
  user: User | null
}

export interface AddedAncillariesProps {
  ancillaries: Ancillary["ancillaryContent"][number][] | null
  booking: Room
}

export interface AncillaryProps {
  ancillary: Ancillary["ancillaryContent"][number]
}

export interface AncillaryGridModalProps {
  ancillaries: Ancillaries
  user: User | null
}

export interface AddAncillaryFlowModalProps {
  booking: Room
  packages: Packages | null
  user: User | null
  savedCreditCards: CreditCard[] | null
}

export type DeliveryTimeOption = {
  label: string
  value: string
}
export interface DeliveryMethodStepProps {
  deliveryTimeOptions: DeliveryTimeOption[]
}

export interface SelectQuantityStepProps {
  user: User | null
}

export interface ConfirmationStepProps {
  savedCreditCards: CreditCard[] | null
  user: User | null
}

export interface StepsProps {
  user: User | null
  savedCreditCards: CreditCard[] | null
}

export interface ActionButtonsProps {
  isPriceDetailsOpen: boolean
  togglePriceDetails: () => void
  isSubmitting: boolean
}
