import type { VariantProps } from "class-variance-authority"
import type { z } from "zod"

import type {
  bookingCodeSchema,
  bookingWidgetSchema,
} from "@/components/Forms/BookingWidget/schema"
import type { bookingWidgetVariants } from "@/components/Forms/BookingWidget/variants"
import type { BookingSearchType } from "../hotelReservation/booking"
import type { GuestsRoom } from "./guestsRoomsPicker"

export type BookingWidgetSchema = z.output<typeof bookingWidgetSchema>
export type BookingCodeSchema = z.output<typeof bookingCodeSchema>

export type BookingWidgetSearchData = {
  city?: string
  hotelId?: string
  fromDate?: string
  toDate?: string
  rooms?: GuestsRoom[]
  bookingCode?: string
  searchType?: BookingSearchType
}

export type BookingWidgetType = VariantProps<
  typeof bookingWidgetVariants
>["type"]

export interface BookingWidgetProps {
  type?: BookingWidgetType
  booking: BookingWidgetSearchData
}

export interface BookingWidgetClientProps {
  type?: BookingWidgetType
  data: BookingWidgetSearchData
  pageSettingsBookingCodePromise: Promise<string> | null
}

export interface BookingWidgetToggleButtonProps {
  openMobileSearch: () => void
}
