import { getBookingConfirmation } from "@/lib/trpc/memoizedRequests"

import Image from "@/components/Image"

import styles from "./image.module.css"

import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation"

export default async function HotelImage({
  confirmationNumber,
}: BookingConfirmationProps) {
  const { hotel } = await getBookingConfirmation(confirmationNumber)
  return (
    <aside className={styles.imageContainer}>
      <Image
        alt={hotel.hotelContent.images.metaData.altText}
        height={256}
        src={hotel.hotelContent.images.imageSizes.medium}
        title={hotel.hotelContent.images.metaData.title}
        width={256}
      />
    </aside>
  )
}
