38 lines
727 B
TypeScript
38 lines
727 B
TypeScript
import {
|
|
BedDoubleIcon,
|
|
BedSingleIcon,
|
|
KingBedSmallIcon,
|
|
} from "@/components/Icons"
|
|
|
|
import type { FC } from "react"
|
|
|
|
import type { IconProps } from "@/types/components/icon"
|
|
|
|
export function getBedIcon(name: string): FC<IconProps> | null {
|
|
const iconMappings = [
|
|
{
|
|
icon: BedDoubleIcon,
|
|
texts: ["Queen"],
|
|
},
|
|
{
|
|
icon: KingBedSmallIcon,
|
|
texts: ["King"],
|
|
},
|
|
{
|
|
icon: KingBedSmallIcon,
|
|
texts: ["CustomOccupancy"],
|
|
},
|
|
{
|
|
icon: BedSingleIcon,
|
|
texts: ["Twin"],
|
|
},
|
|
{
|
|
icon: BedSingleIcon,
|
|
texts: ["Single"],
|
|
},
|
|
]
|
|
|
|
const icon = iconMappings.find((icon) => icon.texts.includes(name))
|
|
return icon ? icon.icon : BedSingleIcon
|
|
}
|