Files
web/app/[lang]/(live)/(public)/hotelreservation/select-rate/page.tsx

46 lines
1.4 KiB
TypeScript

import { serverClient } from "@/lib/trpc/server"
import HotelCard from "@/components/HotelReservation/HotelCard"
import BedSelection from "@/components/HotelReservation/SelectRate/BedSelection"
import BreakfastSelection from "@/components/HotelReservation/SelectRate/BreakfastSelection"
import FlexibilitySelection from "@/components/HotelReservation/SelectRate/FlexibilitySelection"
import RoomSelection from "@/components/HotelReservation/SelectRate/RoomSelection"
import { getLang, setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
export default async function SelectRate({ params }: PageArgs<LangParams>) {
setLang(params.lang)
// TODO: pass the correct hotel ID
const hotel = await serverClient().hotel.getHotel({
hotelId: "879",
language: getLang(),
})
if (!hotel) return null
const { attributes } = hotel
const rooms = await serverClient().hotel.getRates({
// TODO: pass the correct hotel ID and all other parameters that should be included in the search
hotelId: "1",
})
return (
<div className={styles.page}>
<main className={styles.content}>
<div className={styles.hotelInfo}>
<HotelCard hotel={attributes} />
</div>
<RoomSelection rooms={rooms} />
<FlexibilitySelection />
<BreakfastSelection />
<BedSelection />
</main>
</div>
)
}