Files
web/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Img/index.tsx
Erik Tiekstra f04fe467da feat(SW-3151): Added original to imageSchema and added transform to a more generic image type
Approved-by: Bianca Widstam
Approved-by: Chuma Mcphoy (We Ahead)
Approved-by: Matilda Landström
2025-09-10 08:29:05 +00:00

37 lines
786 B
TypeScript

"use client"
import Image from "@scandic-hotels/design-system/Image"
import ImageFallback from "@scandic-hotels/design-system/ImageFallback"
import { useMyStayStore } from "@/stores/my-stay"
import styles from "./img.module.css"
export default function Img() {
const { room, roomName } = useMyStayStore((state) => ({
room: state.bookedRoom.room,
roomName: state.bookedRoom.roomName,
}))
if (!room) {
return null
}
const image = room.images?.[0]
return (
<div className={styles.imageContainer}>
{image?.src ? (
<Image
alt={roomName}
className={styles.image}
height={960}
src={image.src}
width={640}
/>
) : (
<ImageFallback height="640px" />
)}
</div>
)
}