feat(SW-938) Added icon to roomFacilitiesSchema and detailedFacilitySchema
This commit is contained in:
@@ -8,12 +8,15 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
|
||||
import { getFacilityIcon } from "../RoomSidePeek/facilityIcon"
|
||||
|
||||
import styles from "./hotelSidePeek.module.css"
|
||||
|
||||
import { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek"
|
||||
import { ParkingProps } from "@/types/components/hotelReservation/selectHotel/selectHotel"
|
||||
import type { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek"
|
||||
import type { ParkingProps } from "@/types/components/hotelReservation/selectHotel/selectHotel"
|
||||
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
||||
import { Amenities, Hotel } from "@/types/hotel"
|
||||
import { IconName } from "@/types/components/icon"
|
||||
import type { Amenities, Hotel } from "@/types/hotel"
|
||||
|
||||
function getAmenitiesList(hotel: Hotel) {
|
||||
const detailedAmenities: Amenities = hotel.detailedFacilities.filter(
|
||||
@@ -46,7 +49,10 @@ export default function HotelSidePeek({
|
||||
<Accordion>
|
||||
{/* parking */}
|
||||
{hotel.parking.length ? (
|
||||
<AccordionItem title={intl.formatMessage({ id: "Parking" })}>
|
||||
<AccordionItem
|
||||
title={intl.formatMessage({ id: "Parking" })}
|
||||
icon={IconName.Parking}
|
||||
>
|
||||
{hotel.parking.map((p) => (
|
||||
<Parking key={p.name} parking={p} />
|
||||
))}
|
||||
@@ -56,9 +62,19 @@ export default function HotelSidePeek({
|
||||
{intl.formatMessage({ id: "Accessibility" })}
|
||||
</div>
|
||||
{amenitiesList.map((amenity) => {
|
||||
const Icon = getFacilityIcon(amenity.icon)
|
||||
return (
|
||||
<div key={amenity.id} className={styles.amenity}>
|
||||
{amenity.name}
|
||||
{Icon && (
|
||||
<Icon width={24} height={24} color="uiTextMediumContrast" />
|
||||
)}
|
||||
<Body
|
||||
asChild
|
||||
className={!Icon ? styles.noIcon : undefined}
|
||||
color="uiTextMediumContrast"
|
||||
>
|
||||
<span>{amenity.name}</span>
|
||||
</Body>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user