import type { Lang } from "@/constants/languages"
import type { PageContentTypeEnum } from "./requests/contentType"

export type NextSearchParams = { [key: string]: string | string[] | undefined }

export type SearchParams<S = {}> = {
  searchParams: Promise<S & { [key: string]: string }>
}

export type Params<P = {}> = {
  params: Promise<P>
}

export type LangParams = {
  lang: Lang
}

export type StatusParams = {
  status: number
}

export type ContentTypeParams = {
  contentType:
    | PageContentTypeEnum.loyaltyPage
    | PageContentTypeEnum.contentPage
    | PageContentTypeEnum.hotelPage
    | PageContentTypeEnum.collectionPage
    | PageContentTypeEnum.destinationOverviewPage
    | PageContentTypeEnum.destinationCountryPage
    | PageContentTypeEnum.destinationCityPage
    | PageContentTypeEnum.startPage
}

export type ContentTypeWebviewParams = {
  contentType: "loyalty-page" | "account-page"
}

export type UIDParams = {
  uid: string
}

export type UriParams = {
  uri: string | string[]
}

export type PreviewParams = {
  uri?: string
  live_preview?: string
}

export type LayoutArgs<P = undefined> = P extends undefined ? {} : Params<P>

export type PageArgs<P = undefined, S = undefined> = LayoutArgs<P> &
  (S extends undefined ? {} : SearchParams<S>)
