30 lines
627 B
TypeScript
30 lines
627 B
TypeScript
import type { MaterialSymbolProps } from "react-material-symbols"
|
|
|
|
export function getBedIconName(name: string): MaterialSymbolProps["icon"] {
|
|
const iconMappings = [
|
|
{
|
|
icon: "bed",
|
|
texts: ["Queen"],
|
|
},
|
|
{
|
|
icon: "king_bed",
|
|
texts: ["King"],
|
|
},
|
|
{
|
|
icon: "single_bed",
|
|
texts: ["CustomOccupancy"],
|
|
},
|
|
{
|
|
icon: "bed",
|
|
texts: ["Twin"],
|
|
},
|
|
{
|
|
icon: "single_bed",
|
|
texts: ["Single"],
|
|
},
|
|
]
|
|
|
|
const icon = iconMappings.find((icon) => icon.texts.includes(name))
|
|
return icon ? (icon.icon as MaterialSymbolProps["icon"]) : "single_bed"
|
|
}
|