Added the timeSpent to the stats
This commit is contained in:
@@ -153,6 +153,8 @@ export default function History({user}: {user: User}) {
|
||||
level: calculateBandScore(x.correct, x.total, x.module, user.focus),
|
||||
}));
|
||||
|
||||
const timeSpent = dateStats[0].timeSpent;
|
||||
|
||||
const selectExam = () => {
|
||||
const examPromises = uniqBy(dateStats, "exam").map((stat) => getExamById(stat.module, stat.exam));
|
||||
|
||||
@@ -184,7 +186,14 @@ export default function History({user}: {user: User}) {
|
||||
onClick={selectExam}
|
||||
role="button">
|
||||
<div className="w-full flex justify-between items-center">
|
||||
<span className="font-medium">{formatTimestamp(timestamp)}</span>
|
||||
<div className="flex gap-2 items-center">
|
||||
<span className="font-medium">{formatTimestamp(timestamp)}</span>
|
||||
{timeSpent && (
|
||||
<>
|
||||
• <span className="text-sm">{Math.floor(timeSpent / 60)} minutes</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<span
|
||||
className={clsx(
|
||||
correct / total >= 0.7 && "text-mti-purple",
|
||||
|
||||
Reference in New Issue
Block a user