Merged in fix/hoteinfocard-pass-hotel (pull request #1295)

feat:hotel info card - pass hoteldata since we already fetching it on page level

* feat:hotel info card - pass hoteldata since we already fetching it on page level
This commit is contained in:
Linus Flood
2025-02-10 14:31:41 +00:00
parent ec8db51c47
commit 5a0edc9187
3 changed files with 6 additions and 32 deletions

View File

@@ -38,6 +38,7 @@ export default async function SelectRatePage({
const hotelData = await getHotel({
hotelId: hotel.id,
isCardOnlyPayment: false,
language: params.lang,
})
@@ -83,18 +84,8 @@ export default async function SelectRatePage({
return (
<>
<Suspense
key={JSON.stringify(searchParams)}
fallback={<HotelInfoCardSkeleton />}
>
<HotelInfoCard
hotelId={hotelId}
lang={params.lang}
fromDate={fromDate.toDate()}
toDate={toDate.toDate()}
adultArray={adultsInRoom}
childArray={childrenInRoom}
/>
<Suspense fallback={<HotelInfoCardSkeleton />}>
<HotelInfoCard hotelData={hotelData} />
</Suspense>
<Suspense

View File

@@ -1,5 +1,3 @@
import { getHotel } from "@/lib/trpc/memoizedRequests"
import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data"
import ImageGallery from "@/components/ImageGallery"
import SkeletonShimmer from "@/components/SkeletonShimmer"
@@ -19,16 +17,7 @@ import styles from "./hotelInfoCard.module.css"
import type { HotelInfoCardProps } from "@/types/components/hotelReservation/selectRate/hotelInfoCard"
export default async function HotelInfoCard({
hotelId,
lang,
}: HotelInfoCardProps) {
const hotelData = await getHotel({
hotelId: hotelId.toString(),
isCardOnlyPayment: false,
language: lang,
})
export default async function HotelInfoCard({ hotelData }: HotelInfoCardProps) {
const hotel = hotelData?.hotel
const intl = await getIntl()

View File

@@ -1,11 +1,5 @@
import type { Lang } from "@/constants/languages"
import type { Child } from "./selectRate"
import type { HotelData } from "@/types/hotel"
export interface HotelInfoCardProps {
adultArray: number[]
childArray?: Child[]
fromDate: Date
hotelId: number
lang: Lang
toDate: Date
hotelData: HotelData | null
}