feat(sw-453): Added selected types count
This commit is contained in:
@@ -2,6 +2,7 @@ import { getProfileSafely } from "@/lib/trpc/memoizedRequests"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import HotelInfoCard from "@/components/HotelReservation/SelectRate/HotelInfoCard"
|
||||
import RoomFilter from "@/components/HotelReservation/SelectRate/RoomFilter"
|
||||
import RoomSelection from "@/components/HotelReservation/SelectRate/RoomSelection"
|
||||
import getHotelReservationQueryParams from "@/components/HotelReservation/SelectRate/RoomSelection/utils"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
@@ -23,7 +24,7 @@ export default async function SelectRatePage({
|
||||
const adults = selectRoomParamsObject.room[0].adults // TODO: Handle multiple rooms
|
||||
const children = selectRoomParamsObject.room[0].child?.length // TODO: Handle multiple rooms
|
||||
|
||||
const [hotelData, roomConfigurations, user] = await Promise.all([
|
||||
const [hotelData, roomsAvailability, user] = await Promise.all([
|
||||
serverClient().hotel.hotelData.get({
|
||||
hotelId: searchParams.hotel,
|
||||
language: params.lang,
|
||||
@@ -39,7 +40,7 @@ export default async function SelectRatePage({
|
||||
getProfileSafely(),
|
||||
])
|
||||
|
||||
if (!roomConfigurations) {
|
||||
if (!roomsAvailability) {
|
||||
return "No rooms found" // TODO: Add a proper error message
|
||||
}
|
||||
|
||||
@@ -54,8 +55,11 @@ export default async function SelectRatePage({
|
||||
<HotelInfoCard hotelData={hotelData} />
|
||||
<div className={styles.content}>
|
||||
<div className={styles.main}>
|
||||
<RoomFilter
|
||||
numberOfRooms={roomsAvailability.roomConfigurations.length}
|
||||
/>
|
||||
<RoomSelection
|
||||
roomConfigurations={roomConfigurations}
|
||||
roomsAvailability={roomsAvailability}
|
||||
roomCategories={roomCategories ?? []}
|
||||
user={user}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user