Newer
Older
taehui / qwilight-fe / src / components / HitPointsModeText.tsx
@Taehui Taehui on 26 Mar 569 bytes v1.0.0
import { useMemo } from "react";

export default function HitPointsModeText({
  hitPointsMode,
  text,
}: {
  hitPointsMode: number;
  text: string;
}) {
  return (
    <span
      className={useMemo(() => {
        switch (hitPointsMode) {
          case 0:
            return "level2";
          case 2:
            return "level4";
          case 3:
          case 5:
            return "level5";
          case 4:
            return "level1";
          default:
            return "stand";
        }
      }, [hitPointsMode])}
    >
      {text}
    </span>
  );
}