diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Rooms/Room/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Rooms/Room/index.tsx index 9aa2f00b9..883667c2c 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Rooms/Room/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Rooms/Room/index.tsx @@ -102,13 +102,13 @@ export default function Room({
{img.metaData.altText}
diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Img/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Img/index.tsx index 91b209ca2..5b5fbf77f 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Img/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Img/index.tsx @@ -23,7 +23,7 @@ export default function Img() { alt={roomName} className={styles.image} height={960} - src={image.imageSizes.small} + src={image?.imageSizes.small ?? ""} width={640} />
diff --git a/apps/scandic-web/components/Image.tsx b/apps/scandic-web/components/Image.tsx index 4568decaa..840e69a5b 100644 --- a/apps/scandic-web/components/Image.tsx +++ b/apps/scandic-web/components/Image.tsx @@ -2,6 +2,8 @@ import NextImage, { type ImageLoaderProps } from "next/image" +import ImageFallback from "./ImageFallback" + import type { CSSProperties } from "react" import type { ImageProps } from "@/types/components/image" @@ -27,5 +29,9 @@ export default function Image({ focalPoint, style, ...props }: ImageProps) { } : { ...style } + if (!props.src) { + return + } + return } diff --git a/apps/scandic-web/components/ImageFallback/imageFallback.module.css b/apps/scandic-web/components/ImageFallback/imageFallback.module.css index 4e27868d4..20ec0a52f 100644 --- a/apps/scandic-web/components/ImageFallback/imageFallback.module.css +++ b/apps/scandic-web/components/ImageFallback/imageFallback.module.css @@ -2,7 +2,9 @@ display: flex; align-items: center; justify-content: center; - height: 200px; + height: 100%; width: 100%; + min-width: 200px; + min-height: 200px; background-color: var(--Surface-Feedback-Neutral); } diff --git a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/rooms/room.ts b/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/rooms/room.ts index 2f1b5679e..5ca288aed 100644 --- a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/rooms/room.ts +++ b/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/rooms/room.ts @@ -4,6 +4,6 @@ export interface RoomProps { booking: BookingConfirmation["booking"] checkInTime: string checkOutTime: string - img: NonNullable["images"][number] + img?: NonNullable["images"][number] roomName: NonNullable["name"] }