import { Typography } from "@scandic-hotels/design-system/Typography"

import { FacilityToIcon } from "../../../ContentType/HotelPage/data"

import styles from "./additionalAmenities.module.css"

import type { AdditionalAmenitiesProps } from "@/types/components/sidePeeks/amenities"
import { FacilityEnum } from "@/types/enums/facilities"

export default function AdditionalAmenities({
  amenities,
}: AdditionalAmenitiesProps) {
  const amenitiesToIgnore = [
    FacilityEnum.ParkingAdditionalCost,
    FacilityEnum.ParkingElectricCharging,
    FacilityEnum.ParkingFreeParking,
    FacilityEnum.ParkingGarage,
    FacilityEnum.ParkingOutdoor,
    FacilityEnum.MeetingArea,
    FacilityEnum.ServesBreakfastAlwaysIncluded,
    FacilityEnum.LateCheckOutUntil1400Guaranteed,
  ]

  const filteredAmenities = amenities.filter(
    (amenity) => !amenitiesToIgnore.includes(amenity.id)
  )

  return filteredAmenities?.map((amenity) => (
    <Typography key={amenity.name} variant="Title/Subtitle/md">
      <li className={styles.wrapper}>
        <div className={styles.amenity}>
          <FacilityToIcon
            id={amenity.id}
            color="Icon/Interactive/Default"
            size={24}
          />
          {amenity.name}
        </div>
      </li>
    </Typography>
  ))
}
