128 lines
2.2 KiB
TypeScript
128 lines
2.2 KiB
TypeScript
import { FC } from "react"
|
|
|
|
import {
|
|
AcIcon,
|
|
BathtubIcon,
|
|
BedDoubleIcon,
|
|
ChairIcon,
|
|
CityIcon,
|
|
DeskIcon,
|
|
HairdryerIcon,
|
|
HandSoapIcon,
|
|
IronIcon,
|
|
MirrorIcon,
|
|
NatureIcon,
|
|
NoSmokingIcon,
|
|
SafetyBoxIcon,
|
|
ShowerIcon,
|
|
StarFilledIcon,
|
|
StreetIcon,
|
|
WifiIcon,
|
|
WindowCurtainsAltIcon,
|
|
WindowNotAvailableIcon,
|
|
WineBarIcon,
|
|
WoodFloorIcon,
|
|
YardIcon,
|
|
} from "@/components/Icons"
|
|
|
|
import { IconProps } from "@/types/components/icon"
|
|
|
|
export function getFacilityIcon(
|
|
name: string | undefined
|
|
): FC<IconProps> | null {
|
|
if (!name) return StarFilledIcon
|
|
const iconMappings = [
|
|
{
|
|
icon: DeskIcon,
|
|
name: ["Desk and chair"],
|
|
},
|
|
{
|
|
icon: HairdryerIcon,
|
|
name: ["Hairdryer"],
|
|
},
|
|
{
|
|
icon: AcIcon,
|
|
name: ["Air Condition"],
|
|
},
|
|
{
|
|
icon: ChairIcon,
|
|
name: ["Armchair / armchairs"],
|
|
},
|
|
{
|
|
icon: BathtubIcon,
|
|
name: ["Bathroom with shower or bathtub"],
|
|
},
|
|
{
|
|
icon: WindowCurtainsAltIcon,
|
|
name: ["Blackout curtains"],
|
|
},
|
|
{
|
|
icon: MirrorIcon,
|
|
name: ["Cosmetic mirror"],
|
|
},
|
|
{
|
|
icon: WifiIcon,
|
|
name: ["FreeWiFi"],
|
|
},
|
|
{
|
|
icon: ChairIcon,
|
|
name: ["Connecting rooms"],
|
|
},
|
|
{
|
|
icon: YardIcon,
|
|
name: ["View - atrium view"],
|
|
},
|
|
{
|
|
icon: CityIcon,
|
|
name: ["View - city view"],
|
|
},
|
|
{
|
|
icon: NatureIcon,
|
|
name: ["View - park view"],
|
|
},
|
|
{
|
|
icon: StreetIcon,
|
|
name: ["View - street view"],
|
|
},
|
|
{
|
|
icon: WineBarIcon,
|
|
name: ["Minibar"],
|
|
},
|
|
{
|
|
icon: NoSmokingIcon,
|
|
name: ["Non smoking"],
|
|
},
|
|
{
|
|
icon: ShowerIcon,
|
|
name: ["Rain shower"],
|
|
},
|
|
{
|
|
icon: SafetyBoxIcon,
|
|
name: ["Safety box"],
|
|
},
|
|
{
|
|
icon: BedDoubleIcon,
|
|
name: ["Set of two pillows"],
|
|
},
|
|
{
|
|
icon: IronIcon,
|
|
name: ["Iron and ironing board"],
|
|
},
|
|
{
|
|
icon: HandSoapIcon,
|
|
name: ["Toiletries"],
|
|
},
|
|
{
|
|
icon: WoodFloorIcon,
|
|
name: ["Wooden floor"],
|
|
},
|
|
{
|
|
icon: WindowNotAvailableIcon,
|
|
name: ["Not window"],
|
|
},
|
|
]
|
|
|
|
const icon = iconMappings.find((icon) => icon.name.includes(name))
|
|
return icon ? icon.icon : StarFilledIcon
|
|
}
|