diff --git a/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts b/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts deleted file mode 100644 index 3bf8fc496..000000000 --- a/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { FC } from "react" - -import { - AcIcon, - BarIcon, - BathtubIcon, - BedDoubleIcon, - BikeIcon, - BikingIcon, - BreakfastIcon, - BusinessIcon, - ChairIcon, - CityIcon, - CoffeeIcon, - ConciergeIcon, - DeskIcon, - ElectricBikeIcon, - ElectricCarIcon, - FitnessIcon, - GarageIcon, - HairdryerIcon, - HandSoapIcon, - HeartIcon, - IronIcon, - KayakingIcon, - LaundryMachineIcon, - LocalBarIcon, - MirrorIcon, - NatureIcon, - NightlifeIcon, - NoSmokingIcon, - OutdoorFurnitureIcon, - ParkingIcon, - RestaurantIcon, - RoomServiceIcon, - SafetyBoxIcon, - SaunaIcon, - ShoppingIcon, - ShowerIcon, - SkateboardingIcon, - StarFilledIcon, - StoreIcon, - StreetIcon, - SwimIcon, - WifiIcon, - WindowCurtainsAltIcon, - WindowNotAvailableIcon, - WineBarIcon, - WoodFloorIcon, - YardIcon, -} from "@/components/Icons" - -import { IconProps } from "@/types/components/icon" - -export function getHotelFacilityIcon( - name: string | undefined -): FC | null { - if (!name) return StarFilledIcon - - const iconMappings = [ - { - icon: FitnessIcon, - name: ["Gym"], - }, - { - icon: SwimIcon, - name: ["Pool"], - }, - { - icon: WifiIcon, - name: ["FreeWiFi"], - }, - { - icon: LaundryMachineIcon, - name: ["LaundryService"], - }, - { - icon: LaundryMachineIcon, - name: ["ExpressLaundryService"], - }, - { - icon: ParkingIcon, - name: ["Parking"], - }, - { - icon: GarageIcon, - name: ["Garage"], - }, - { - icon: BikeIcon, - name: ["BikesForLoan"], - }, - { - icon: ElectricCarIcon, - name: ["ElectricChargingPoint"], - }, - { - icon: KayakingIcon, - name: ["KayaksForLoan"], - }, - { - icon: SkateboardingIcon, - name: ["SkateboardsForLoan"], - }, - { - icon: NightlifeIcon, - name: ["LiveMusicExhibitions"], - }, - { - icon: StoreIcon, - name: ["Shop"], - }, - { - icon: CoffeeIcon, - name: ["Cafe"], - }, - { - icon: BusinessIcon, - name: ["Meeting"], - }, - { - icon: LocalBarIcon, - name: ["Bar"], - }, - { - icon: RoomServiceIcon, - name: ["RoomService"], - }, - { - icon: OutdoorFurnitureIcon, - name: ["OutdoorTerrace"], - }, - { - icon: RestaurantIcon, - name: ["Restaurant"], - }, - { - icon: LocalBarIcon, - name: ["Skybar"], - }, - { - icon: BreakfastIcon, - name: ["Breakfast"], - }, - { - icon: SaunaIcon, - name: ["Sauna"], - }, - { - icon: ConciergeIcon, - name: ["LifestyleConcierge"], - }, - ] - - const icon = iconMappings.find((icon) => icon.name.includes(name)) - return icon ? icon.icon : StarFilledIcon -} diff --git a/components/SidePeeks/HotelSidePeek/index.tsx b/components/SidePeeks/HotelSidePeek/index.tsx index 3a77ce8dc..b26570bb7 100644 --- a/components/SidePeeks/HotelSidePeek/index.tsx +++ b/components/SidePeeks/HotelSidePeek/index.tsx @@ -1,5 +1,6 @@ import { useIntl } from "react-intl" +import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data" import Contact from "@/components/HotelReservation/Contact" import { AccessibilityIcon } from "@/components/Icons" import Accordion from "@/components/TempDesignSystem/Accordion" @@ -9,8 +10,6 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import { getHotelFacilityIcon } from "./hotelFacilityIcon" - import styles from "./hotelSidePeek.module.css" import type { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek" @@ -68,7 +67,7 @@ export default function HotelSidePeek({ {intl.formatMessage({ id: "Accessibility" })} {amenitiesList.map((amenity) => { - const Icon = getHotelFacilityIcon(amenity.icon) + const Icon = mapFacilityToIcon(amenity.id) return (
{Icon && (