import type { RouterOutput } from "@/lib/trpc/client" export function getBookedHotelRoom( hotel: RouterOutput["booking"]["confirmation"]["hotel"], roomTypeCode: string ) { const room = hotel.included?.find((include) => { return include.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, } }