From 42ed0d275bb5f80d0fb967e3b542eafb45395ff3 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 28 Jun 2026 19:36:35 -0700 Subject: [PATCH] fix: Update category breakdown layout to grid to prevent text truncation --- src/components/quizzes/CategoryBreakdown.tsx | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/components/quizzes/CategoryBreakdown.tsx b/src/components/quizzes/CategoryBreakdown.tsx index 412b18d..6f16b22 100644 --- a/src/components/quizzes/CategoryBreakdown.tsx +++ b/src/components/quizzes/CategoryBreakdown.tsx @@ -1,5 +1,6 @@ "use client"; +import { Fragment } from "react"; import { scoreQuestion } from "@/lib/scoring"; interface CategoryBreakdownProps { @@ -32,7 +33,7 @@ export function CategoryBreakdown({ quiz, attempt, answeredIds, answers }: Categ const categories = Object.keys(stats).sort(); return ( -
+
{categories.map((cat) => { const { earned, possible } = stats[cat]; const pct = possible > 0 ? (earned / possible) * 100 : 0; @@ -42,24 +43,22 @@ export function CategoryBreakdown({ quiz, attempt, answeredIds, answers }: Categ else if (pct >= 80) colorClass = "bg-success"; return ( -
-
+ +
{cat}
-
-
-
-
+
+
-
+
{earned.toFixed(1)} / {possible}
-
+ ); })}