import { MembershipLevelEnum } from "@/constants/membershipLevels"

import {
  BestFriend,
  BestFriendSingle,
  CloseFriend,
  CloseFriendSingle,
  DearFriend,
  DearFriendSingle,
  GoodFriend,
  GoodFriendSingle,
  LoyalFriend,
  LoyalFriendSingle,
  NewFriend,
  NewFriendSingle,
  TrueFriend,
  TrueFriendSingle,
} from "@/components/Levels"

import type { MembershipLevelIconProps } from "@/types/components/myPages/membership"

export default function MembershipLevelIcon({
  level,
  rows = 2,
  color = "pale",
  ...props
}: MembershipLevelIconProps) {
  switch (level) {
    case MembershipLevelEnum.L1:
      switch (rows) {
        case 1:
          return <NewFriendSingle color={color} {...props} />
        case 2:
          return <NewFriend color={color} {...props} />
      }
    case MembershipLevelEnum.L2:
      switch (rows) {
        case 1:
          return <GoodFriendSingle color={color} {...props} />
        case 2:
          return <GoodFriend color={color} {...props} />
      }
    case MembershipLevelEnum.L3:
      switch (rows) {
        case 1:
          return <CloseFriendSingle color={color} {...props} />
        case 2:
          return <CloseFriend color={color} {...props} />
      }
    case MembershipLevelEnum.L4:
      switch (rows) {
        case 1:
          return <DearFriendSingle color={color} {...props} />
        case 2:
          return <DearFriend color={color} {...props} />
      }
    case MembershipLevelEnum.L5:
      switch (rows) {
        case 1:
          return <LoyalFriendSingle color={color} {...props} />
        case 2:
          return <LoyalFriend color={color} {...props} />
      }
    case MembershipLevelEnum.L6:
      switch (rows) {
        case 1:
          return <TrueFriendSingle color={color} {...props} />
        case 2:
          return <TrueFriend color={color} {...props} />
      }
    case MembershipLevelEnum.L7:
      switch (rows) {
        case 1:
          return <BestFriendSingle color={color} {...props} />
        case 2:
          return <BestFriend color={color} {...props} />
      }
    default:
      return null
  }
}
