import { FC } from "react"

import {
  AcIcon,
  BathtubIcon,
  BedDoubleIcon,
  ChairIcon,
  CityIcon,
  DeskIcon,
  HairdryerIcon,
  HandSoapIcon,
  HeartIcon,
  IronIcon,
  MirrorIcon,
  NatureIcon,
  NoSmokingIcon,
  SafetyBoxIcon,
  ShowerIcon,
  StreetIcon,
  WifiIcon,
  WindowCurtainsAltIcon,
  WindowNotAvailableIcon,
  WineBarIcon,
  WoodFloorIcon,
  YardIcon,
} from "@/components/Icons"

import { IconProps } from "@/types/components/icon"

export function getFacilityIcon(name: string): FC<IconProps> | null {
  const iconMappings = [
    {
      icon: DeskIcon,
      texts: ["Desk and chair"],
    },
    {
      icon: HairdryerIcon,
      texts: ["Hairdryer"],
    },
    {
      icon: AcIcon,
      texts: ["Air Condition"],
    },
    {
      icon: ChairIcon,
      texts: ["Armchair / armchairs"],
    },
    {
      icon: BathtubIcon,
      texts: ["Bathroom with shower or bathtub"],
    },
    {
      icon: WindowCurtainsAltIcon,
      texts: ["Blackout curtains"],
    },
    {
      icon: MirrorIcon,
      texts: ["Cosmetic mirror"],
    },
    {
      icon: WifiIcon,
      texts: ["Free WiFi"],
    },
    {
      icon: ChairIcon,
      texts: ["Connecting rooms"],
    },
    {
      icon: YardIcon,
      texts: ["View - atrium view"],
    },
    {
      icon: CityIcon,
      texts: ["View - city view"],
    },
    {
      icon: NatureIcon,
      texts: ["View - park view"],
    },
    {
      icon: StreetIcon,
      texts: ["View - street view"],
    },
    {
      icon: WineBarIcon,
      texts: ["Minibar"],
    },
    {
      icon: NoSmokingIcon,
      texts: ["Non smoking"],
    },
    {
      icon: ShowerIcon,
      texts: ["Rain shower"],
    },
    {
      icon: SafetyBoxIcon,
      texts: ["Safety box"],
    },
    {
      icon: BedDoubleIcon,
      texts: ["Set of two pillows"],
    },
    {
      icon: IronIcon,
      texts: ["Iron and ironing board"],
    },
    {
      icon: HandSoapIcon,
      texts: ["Toiletries"],
    },
    {
      icon: WoodFloorIcon,
      texts: ["Wooden floor"],
    },
    {
      icon: WindowNotAvailableIcon,
      texts: ["Not window"],
    },
  ]

  const icon = iconMappings.find((icon) => icon.texts.includes(name))
  return icon ? icon.icon : HeartIcon
}
