Files
web/apps/scandic-web/components/HotelReservation/HotelCardDialog/index.tsx
Matilda Landström 5de2a993a7 Merged in feat/SW-1711-switch-icons (pull request #1558)
Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons.

Approved-by: Michael Zetterberg
Approved-by: Erik Tiekstra
2025-03-27 09:42:52 +00:00

56 lines
1.4 KiB
TypeScript

"use client"
import { useParams } from "next/navigation"
import { useState } from "react"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
import ListingHotelCardDialog from "./ListingHotelCardDialog"
import StandaloneHotelCardDialog from "./StandaloneHotelCardDialog"
import styles from "./hotelCardDialog.module.css"
import type { HotelCardDialogProps } from "@/types/components/hotelReservation/selectHotel/map"
import type { Lang } from "@/constants/languages"
export default function HotelCardDialog({
data,
isOpen,
type = "standalone",
handleClose,
}: HotelCardDialogProps) {
const params = useParams()
const lang = params.lang as Lang
const [imageError, setImageError] = useState(false)
if (!data) {
return null
}
return (
<dialog open={isOpen} className={styles.dialog}>
<div className={styles.dialogContainer} data-type={type}>
<div onClick={handleClose}>
<MaterialIcon icon="close" className={styles.closeIcon} size={16} />
</div>
{type === "standalone" ? (
<StandaloneHotelCardDialog
data={data}
lang={lang}
imageError={imageError}
setImageError={setImageError}
/>
) : (
<ListingHotelCardDialog
data={data}
lang={lang}
imageError={imageError}
setImageError={setImageError}
/>
)}
</div>
</dialog>
)
}