Files
web/packages/trpc/lib/routers/booking/helpers.ts
Bianca Widstam d9b858c823 Merged in feat/SW-3289-replace-sidepeek-hotel-reservation (pull request #2686)
feat(SW-3289): replace sidepeek

* fix(SW-3289): replace sidepeek

* fix(SW-3289): add wrapping prop and change prop name to buttonVariant

* fix(SW-3289): replace body with typography

* fix(SW-3289): fix intl message


Approved-by: Joakim Jäderberg
2025-08-22 11:43:39 +00:00

28 lines
618 B
TypeScript

import type { BookingConfirmation } from "../../types/bookingConfirmation"
import type { Room } from "../../types/hotel"
export function getHotelRoom(
rooms: Room[],
roomTypeCode: BookingConfirmation["booking"]["roomTypeCode"]
) {
if (!rooms.length || !roomTypeCode) {
return null
}
const room = rooms.find((r) => {
return r.roomTypes.find((roomType) => roomType.code === roomTypeCode)
})
if (!room) {
return null
}
const bedType = room.roomTypes.find(
(roomType) => roomType.code === roomTypeCode
)
if (!bedType) {
return null
}
return {
...room,
bedType,
}
}