Files
web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx
Linus Flood 1116bdafa8 Merged in fix/suspense-key (pull request #1356)
feat: suspense key - use json-stable-stringify for suspense key

* feat: suspense key - use json-stable-stringify for suspense key


Approved-by: Joakim Jäderberg
2025-02-17 09:42:54 +00:00

25 lines
855 B
TypeScript

import stringify from "json-stable-stringify-without-jsonify"
import { Suspense } from "react"
import SelectHotel from "@/components/HotelReservation/SelectHotel"
import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton"
import { setLang } from "@/i18n/serverContext"
import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
import type { LangParams, PageArgs } from "@/types/params"
export default async function SelectHotelPage({
params,
searchParams,
}: PageArgs<LangParams, SelectHotelSearchParams>) {
setLang(params.lang)
const suspenseKey = stringify(searchParams)
return (
<Suspense key={suspenseKey} fallback={<SelectHotelSkeleton />}>
<SelectHotel params={params} searchParams={searchParams} />
</Suspense>
)
}