import { Module } from "@/interfaces"; import useExamStore from "@/stores/examStore"; import { moduleLabels } from "@/utils/moduleUtils"; import clsx from "clsx"; import { motion } from "framer-motion"; import { ReactNode, useEffect, useState } from "react"; import { BsBook, BsClipboard, BsHeadphones, BsMegaphone, BsPen, BsStopwatch } from "react-icons/bs"; import ProgressBar from "../Low/ProgressBar"; import TimerEndedModal from "../TimerEndedModal"; import Timer from "./Timer"; interface Props { minTimer: number; module: Module; label?: string; exerciseIndex: number; totalExercises: number; disableTimer?: boolean; partLabel?: string; showTimer?: boolean; } export default function ModuleTitle({ minTimer, module, label, exerciseIndex, totalExercises, disableTimer = false, partLabel, showTimer = true }: Props) { const moduleIcon: { [key in Module]: ReactNode } = { reading: , listening: , writing: , speaking: , level: , }; return ( <> {showTimer && }
{partLabel &&
{partLabel.split('\n\n').map((line, index) => { if(index == 0) return

{line}

else return

{line}

})}
}
{moduleIcon[module]}
{moduleLabels[module]} exam {label && `- ${label}`} Question {exerciseIndex}/{totalExercises}
); }