import {Step} from "@/interfaces"; import {getGradingLabel, getLevelLabel} from "@/utils/score"; import clsx from "clsx"; import {BsBook, BsClipboard, BsHeadphones, BsMegaphone, BsPen} from "react-icons/bs"; const ModuleBadge: React.FC<{module: string; level?: number; gradingSystem?: Step[]; className?: string}> = ({ module, level, gradingSystem, className, }) => (
{module === "reading" && } {module === "listening" && } {module === "writing" && } {module === "speaking" && } {module === "level" && } {/* do not switch to level && it will convert the 0.0 to 0*/} {level !== undefined && ( {module === "level" && gradingSystem ? getGradingLabel(level, gradingSystem) : level.toFixed(1)} )}
); export default ModuleBadge;