import { FC } from "react"

import {
  BedDoubleIcon,
  BedSingleIcon,
  KingBedSmallIcon,
} from "@/components/Icons"

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
}
