fix(ui): refactor results page for exam results logic

This commit is contained in:
shafin-r
2025-08-31 23:27:32 +06:00
parent 7df2708db7
commit 5507602031
9 changed files with 127 additions and 444 deletions

View File

@ -2,7 +2,7 @@
import React from "react";
import { useRouter } from "next/navigation";
import { ChevronLeft, Layers } from "lucide-react";
import { ChevronLeft, Layers, Loader } from "lucide-react";
import { useTimer } from "@/context/TimerContext";
import styles from "@/css/Header.module.css";
import { useExam } from "@/context/ExamContext";
@ -53,8 +53,12 @@ const Header = ({
{displayUser && (
<div className={styles.profile}>
<Avatar className="bg-gray-200 w-10 h-10">
<AvatarFallback className=" text-lg">
{user?.username ? user.username.charAt(0).toUpperCase() : "U"}
<AvatarFallback className="flex items-center justify-center h-10 text-lg">
{user?.username ? (
user.username.charAt(0).toUpperCase()
) : (
<div className="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"></div>
)}
</AvatarFallback>
</Avatar>
<span className={styles.text}>