feat(SW-3695): use svg icons instead of font icons * feat(icons): use svg instead of font icons * feat(icons): use webpack/svgr for inlined svgs. Now support for isFilled again * Merge master * Remove old font icon Approved-by: Joakim Jäderberg
30 lines
647 B
TypeScript
30 lines
647 B
TypeScript
import type { MaterialIconProps } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|
|
|
export function getBedIconName(name: string): MaterialIconProps["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 MaterialIconProps["icon"]) : "single_bed"
|
|
}
|