Consolidate autocomplete search SW-2253 SW-2338 * use fuse.js for fuzzy search * Handle weird behaviour when search field loses focus on destinationPage * Add error logging for JumpTo when no URL was provided * Switch to use <Typography /> over <Caption /> * fix: bookingWidget search label should always be red * fix: searchHistory can no longer add invalid items * fix: list more hits when searching * fix: issue when searchField value was undefined * fix: don't show searchHistory label if no searchHistory items * simplify skeleton for listitems in search Approved-by: Linus Flood
13 lines
330 B
TypeScript
13 lines
330 B
TypeScript
import { z } from "zod"
|
|
|
|
export const autoCompleteLocationSchema = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.enum(["cities", "hotels"]),
|
|
searchTokens: z.array(z.string()),
|
|
destination: z.string(),
|
|
url: z.string().optional(),
|
|
})
|
|
|
|
export type AutoCompleteLocation = z.infer<typeof autoCompleteLocationSchema>
|