feat(SW-1652): Fetching additional rooms on confirmation page * feat(SW-1652): Fetching additional rooms on confirmation page Approved-by: Tobias Johansson
23 lines
519 B
TypeScript
23 lines
519 B
TypeScript
import { serverClient } from "@/lib/trpc/server"
|
|
|
|
import Room from "../Room"
|
|
|
|
export async function LinkedReservation({
|
|
confirmationNumber,
|
|
}: {
|
|
confirmationNumber: string
|
|
}) {
|
|
const confirmation = await serverClient().booking.confirmation({
|
|
confirmationNumber,
|
|
})
|
|
|
|
const room = confirmation?.room
|
|
const booking = confirmation?.booking
|
|
|
|
if (!booking || !room) {
|
|
return <div>Something went wrong, try again</div>
|
|
}
|
|
|
|
return <Room booking={booking} img={room.images[0]} roomName={room.name} />
|
|
}
|