55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import { dialogVariants } from "@/components/Forms/BookingWidget/FormContent/Search/SearchList/Dialog/variants"
|
|
|
|
import type { VariantProps } from "class-variance-authority"
|
|
import type { PropGetters } from "downshift"
|
|
|
|
import type { Location, Locations } from "../trpc/routers/hotel/locations"
|
|
|
|
export interface SearchProps {
|
|
locations: Locations
|
|
}
|
|
|
|
type HighlightedIndex = number | null
|
|
|
|
export interface SearchListProps {
|
|
getItemProps: PropGetters<unknown>["getItemProps"]
|
|
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
|
isOpen: boolean
|
|
highlightedIndex: HighlightedIndex
|
|
locations: Locations
|
|
search: string
|
|
searchHistory: Locations | null
|
|
}
|
|
|
|
export interface ListProps {
|
|
getItemProps: PropGetters<unknown>["getItemProps"]
|
|
highlightedIndex: HighlightedIndex
|
|
initialIndex?: number
|
|
label?: string
|
|
locations: Locations
|
|
}
|
|
|
|
export interface ListItemProps {
|
|
getItemProps: PropGetters<unknown>["getItemProps"]
|
|
highlightedIndex: HighlightedIndex
|
|
index: number
|
|
location: Location
|
|
}
|
|
|
|
export interface DialogProps
|
|
extends React.PropsWithChildren,
|
|
VariantProps<typeof dialogVariants> {
|
|
className?: string
|
|
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
|
}
|
|
|
|
export interface ErrorDialogProps extends React.PropsWithChildren {
|
|
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
|
}
|
|
|
|
export interface ClearSearchButtonProps {
|
|
getItemProps: PropGetters<unknown>["getItemProps"]
|
|
highlightedIndex: HighlightedIndex
|
|
index: number
|
|
}
|