feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
54
types/components/search.ts
Normal file
54
types/components/search.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user