fix(SW-952): New HotelCard for Map in mobile
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { TripAdvisorIcon } from "@/components/Icons"
|
||||
import Image from "@/components/Image"
|
||||
import Chip from "@/components/TempDesignSystem/Chip"
|
||||
|
||||
import { hotelCardDialogImageVariants } from "./variants"
|
||||
|
||||
import styles from "./hotelCardDialogImage.module.css"
|
||||
|
||||
import type { HotelCardDialogImageProps } from "@/types/components/hotelReservation/selectHotel/map"
|
||||
|
||||
export default function HotelCardDialogImage({
|
||||
firstImage,
|
||||
altText,
|
||||
ratings,
|
||||
imageError,
|
||||
setImageError,
|
||||
position,
|
||||
}: HotelCardDialogImageProps) {
|
||||
const classNames = hotelCardDialogImageVariants({ position })
|
||||
|
||||
return (
|
||||
<div className={classNames}>
|
||||
{!firstImage || imageError ? (
|
||||
<div className={styles.imagePlaceholder} />
|
||||
) : (
|
||||
<Image
|
||||
src={firstImage}
|
||||
alt={altText || ""}
|
||||
fill
|
||||
onError={() => setImageError(true)}
|
||||
/>
|
||||
)}
|
||||
<div className={styles.tripAdvisor}>
|
||||
<Chip intent="secondary" className={styles.tripAdvisor}>
|
||||
<TripAdvisorIcon color="burgundy" />
|
||||
{ratings}
|
||||
</Chip>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user