Tighten reorder content UI and rename exam prep tab.

Make hierarchy lists denser and label the exam prep tab as Duolingo/IELTS.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-07-30 00:47:28 -07:00
parent 524e891e73
commit f5ccf64cee
3 changed files with 166 additions and 174 deletions

View File

@ -10,45 +10,50 @@ export function ReorderContentPage() {
const [tab, setTab] = useState<ReorderTab>("learn_english"); const [tab, setTab] = useState<ReorderTab>("learn_english");
return ( return (
<div className="space-y-8 animate-in fade-in duration-500 pb-20"> <div className="animate-in fade-in space-y-4 pb-10 duration-500">
<div className="space-y-6"> <div className="space-y-3">
<PageBackLink fallbackTo="/new-content" label="Back to Content Management" iconClassName="h-5 w-5 group-hover:-translate-x-1" /> <PageBackLink
fallbackTo="/new-content"
label="Back to Content Management"
iconClassName="h-4 w-4 group-hover:-translate-x-1"
/>
<div className="space-y-1"> <div className="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
<h1 className="text-2xl font-bold tracking-tight text-grayScale-700"> <div className="min-w-0 space-y-0.5">
Reorder Content <h1 className="text-xl font-bold tracking-tight text-grayScale-700">
</h1> Reorder Content
<p className="max-w-2xl text-sm text-grayScale-500"> </h1>
Drag and drop items to change their display order. Changes are saved <p className="max-w-2xl text-xs text-grayScale-500">
automatically when you drop an item. Drag and drop to change order. Changes save automatically on drop.
</p> </p>
</div> </div>
<div className="flex gap-2 rounded-lg border border-grayScale-200 bg-grayScale-50 p-1 w-fit"> <div className="flex w-fit shrink-0 gap-0.5 rounded-md border border-grayScale-200 bg-grayScale-50 p-0.5">
<button <button
type="button" type="button"
onClick={() => setTab("learn_english")} onClick={() => setTab("learn_english")}
className={cn( className={cn(
"rounded-md px-4 py-2 text-sm font-semibold transition-colors", "rounded px-3 py-1.5 text-xs font-semibold transition-colors",
tab === "learn_english" tab === "learn_english"
? "bg-white text-grayScale-900 shadow-sm" ? "bg-white text-grayScale-900 shadow-sm"
: "text-grayScale-500 hover:text-grayScale-700", : "text-grayScale-500 hover:text-grayScale-700",
)} )}
> >
Learn English Learn English
</button> </button>
<button <button
type="button" type="button"
onClick={() => setTab("exam_prep")} onClick={() => setTab("exam_prep")}
className={cn( className={cn(
"rounded-md px-4 py-2 text-sm font-semibold transition-colors", "rounded px-3 py-1.5 text-xs font-semibold transition-colors",
tab === "exam_prep" tab === "exam_prep"
? "bg-white text-grayScale-900 shadow-sm" ? "bg-white text-grayScale-900 shadow-sm"
: "text-grayScale-500 hover:text-grayScale-700", : "text-grayScale-500 hover:text-grayScale-700",
)} )}
> >
Exam prep Duolingo/IELTS
</button> </button>
</div>
</div> </div>
</div> </div>

View File

@ -33,7 +33,6 @@ import {
RotateCcw, RotateCcw,
Edit2, Edit2,
Trash2, Trash2,
Image as ImageIcon,
Loader2, Loader2,
} from "lucide-react"; } from "lucide-react";
import { cn } from "../../../lib/utils"; import { cn } from "../../../lib/utils";
@ -113,23 +112,22 @@ function SortableItem({
ref={setNodeRef} ref={setNodeRef}
style={style} style={style}
className={cn( className={cn(
"flex items-center justify-between px-4 py-3 border border-grayScale-200 rounded-[6px] mb-2 bg-white dark:bg-grayScale-50 transition-all duration-200 group/item", "group/item mb-1 flex items-center justify-between rounded border border-grayScale-200 bg-white px-2 py-1.5 transition-all duration-150 dark:bg-grayScale-50",
isDragging && "opacity-50 border-dashed z-50 shadow-sm", isDragging && "z-50 border-dashed opacity-50 shadow-sm",
!isDragging && "hover:border-brand-200 hover:shadow-sm", !isDragging && "hover:border-brand-200 hover:shadow-sm",
)} )}
> >
<div className="flex items-center gap-4"> <div className="flex min-w-0 items-center gap-2">
<button <button
{...attributes} {...attributes}
{...listeners} {...listeners}
className="cursor-grab active:cursor-grabbing p-1 text-grayScale-300 hover:text-brand-500 transition-colors" className="cursor-grab p-0.5 text-grayScale-300 transition-colors hover:text-brand-500 active:cursor-grabbing"
> >
<GripVertical className="h-4 w-4" /> <GripVertical className="h-3.5 w-3.5" />
</button> </button>
<div className="flex items-center gap-3"> <div className="flex min-w-0 items-center gap-2">
{/* Thumbnail/Icon Container */} <div className="flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded border border-grayScale-100 bg-grayScale-50">
<div className="h-10 w-10 shrink-0 rounded-[4px] bg-grayScale-50 border border-grayScale-100 flex items-center justify-center overflow-hidden">
{thumbnail ? ( {thumbnail ? (
<img <img
src={thumbnail} src={thumbnail}
@ -137,36 +135,40 @@ function SortableItem({
className="h-full w-full object-cover" className="h-full w-full object-cover"
/> />
) : ( ) : (
<div className="text-grayScale-400 group-hover/item:text-brand-500 transition-colors"> <div className="text-grayScale-400 transition-colors group-hover/item:text-brand-500 [&>svg]:h-3.5 [&>svg]:w-3.5">
{icon} {icon}
</div> </div>
)} )}
</div> </div>
<div className="flex flex-col"> <span className="truncate text-xs font-semibold leading-tight text-grayScale-800">
<span className="text-[14px] font-bold text-grayScale-800 leading-tight"> {name}
{name} </span>
</span>
</div>
</div> </div>
</div> </div>
<div className="flex items-center gap-1 opacity-0 group-hover/item:opacity-100 transition-opacity"> {(onEdit || onDelete) && (
<button <div className="flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover/item:opacity-100">
onClick={() => onEdit?.(id)} {onEdit ? (
className="p-2 text-grayScale-400 rounded-[4px] transition-all" <button
title="Edit" onClick={() => onEdit(id)}
> className="rounded p-1 text-grayScale-400 transition-all"
<Edit2 className="h-3.5 w-3.5" /> title="Edit"
</button> >
<button <Edit2 className="h-3 w-3" />
onClick={() => onDelete?.(id)} </button>
className="p-2 text-grayScale-400 rounded-[4px] transition-all" ) : null}
title="Delete" {onDelete ? (
> <button
<Trash2 className="h-3.5 w-3.5" /> onClick={() => onDelete(id)}
</button> className="rounded p-1 text-grayScale-400 transition-all"
</div> title="Delete"
>
<Trash2 className="h-3 w-3" />
</button>
) : null}
</div>
)}
</div> </div>
); );
} }
@ -216,7 +218,7 @@ export function DraggableList({
onDragEnd={handleDragEnd} onDragEnd={handleDragEnd}
> >
<SortableContext items={items} strategy={verticalListSortingStrategy}> <SortableContext items={items} strategy={verticalListSortingStrategy}>
<div className="flex flex-col gap-1"> <div className="flex flex-col">
{items.map((item) => ( {items.map((item) => (
<SortableItem <SortableItem
key={item.id} key={item.id}
@ -232,28 +234,22 @@ export function DraggableList({
</SortableContext> </SortableContext>
<DragOverlay> <DragOverlay>
{activeItem ? ( {activeItem ? (
<div className="flex items-center justify-between px-4 py-3 bg-white dark:bg-grayScale-50 border border-brand-300 shadow-lg rounded-[6px] opacity-90 cursor-grabbing"> <div className="flex cursor-grabbing items-center gap-2 rounded border border-brand-300 bg-white px-2 py-1.5 opacity-90 shadow-lg dark:bg-grayScale-50">
<div className="flex items-center gap-4"> <GripVertical className="h-3.5 w-3.5 text-grayScale-400" />
<div className="p-1 "> <div className="flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded border border-grayScale-100 bg-grayScale-50">
<GripVertical className="h-4 w-4" /> {activeItem.thumbnail ? (
</div> <img
<div className="flex items-center gap-3"> src={activeItem.thumbnail}
<div className="h-10 w-10 shrink-0 rounded-[4px] bg-grayScale-50 border border-grayScale-100 flex items-center justify-center overflow-hidden"> alt={activeItem.name}
{activeItem.thumbnail ? ( className="h-full w-full object-cover"
<img />
src={activeItem.thumbnail} ) : (
alt={activeItem.name} <div className="text-brand-500 [&>svg]:h-3.5 [&>svg]:w-3.5">{icon}</div>
className="h-full w-full object-cover" )}
/>
) : (
<div className="text-brand-500">{icon}</div>
)}
</div>
<span className="text-[14px] font-bold text-grayScale-800">
{activeItem.name}
</span>
</div>
</div> </div>
<span className="truncate text-xs font-semibold text-grayScale-800">
{activeItem.name}
</span>
</div> </div>
) : null} ) : null}
</DragOverlay> </DragOverlay>
@ -277,18 +273,18 @@ export function HierarchySection({
children, children,
}: SectionProps) { }: SectionProps) {
return ( return (
<div className="border border-grayScale-100 rounded-xl mb-3 overflow-hidden transition-all duration-300 bg-white dark:bg-grayScale-50"> <div className="mb-2 overflow-hidden rounded-lg border border-grayScale-100 bg-white transition-all duration-200 dark:bg-grayScale-50">
<button <button
onClick={onToggle} onClick={onToggle}
className={cn( className={cn(
"w-full flex items-center justify-between px-5 py-4 transition-colors", "flex w-full items-center justify-between px-3 py-2 transition-colors",
isOpen ? "bg-grayScale-50" : "hover:bg-grayScale-25", isOpen ? "bg-grayScale-50" : "hover:bg-grayScale-25",
)} )}
> >
<div className="flex items-center gap-3"> <div className="flex items-center gap-2">
<div <div
className={cn( className={cn(
"p-2 rounded-lg transition-colors", "rounded p-1.5 transition-colors [&>svg]:h-3.5 [&>svg]:w-3.5",
isOpen isOpen
? "bg-brand-300 text-white" ? "bg-brand-300 text-white"
: "bg-grayScale-50 text-grayScale-500", : "bg-grayScale-50 text-grayScale-500",
@ -298,7 +294,7 @@ export function HierarchySection({
</div> </div>
<span <span
className={cn( className={cn(
"text-[15px] font-bold", "text-sm font-semibold",
isOpen ? "text-grayScale-900" : "text-grayScale-700", isOpen ? "text-grayScale-900" : "text-grayScale-700",
)} )}
> >
@ -306,19 +302,14 @@ export function HierarchySection({
</span> </span>
</div> </div>
{isOpen ? ( {isOpen ? (
<ChevronDown className="h-5 w-5 text-grayScale-400" /> <ChevronDown className="h-4 w-4 text-grayScale-400" />
) : ( ) : (
<ChevronRight className="h-5 w-5 text-grayScale-400" /> <ChevronRight className="h-4 w-4 text-grayScale-400" />
)} )}
</button> </button>
<div {isOpen ? (
className={cn( <div className="border-t border-grayScale-100 px-3 py-2">{children}</div>
"transition-all duration-300 ease-in-out overflow-hidden", ) : null}
isOpen ? "max-h-[1000px] opacity-100 p-5 pt-0" : "max-h-0 opacity-0",
)}
>
<div className="pt-4 border-t border-grayScale-200">{children}</div>
</div>
</div> </div>
); );
} }
@ -559,36 +550,35 @@ export function ContentHierarchyList() {
}; };
return ( return (
<div className="bg-[#ffffff] rounded-2xl p-6 border border-grayScale-100 mb-8 shadow-sm"> <div className="mb-4 rounded-xl border border-grayScale-100 bg-white p-3 shadow-sm">
<div className="flex items-center justify-between mb-6"> <div className="mb-3 flex items-center justify-between gap-3">
<div> <div className="min-w-0">
<h3 className="text-[16px] font-bold text-grayScale-900"> <h3 className="text-sm font-bold text-grayScale-900">
Content Hierarchy Content Hierarchy
</h3> </h3>
<p className="text-[12px] text-grayScale-500 mt-1"> <p className="text-[11px] text-grayScale-500">
Manage the ordering and structure of your educational content Drag items to reorder Learn English content
</p> </p>
</div> </div>
<button <button
onClick={handleReset} onClick={handleReset}
className="text-[13px] font-bold text-brand-300 hover:text-brand-400 transition-colors flex items-center gap-2 group" className="group flex shrink-0 items-center gap-1.5 text-xs font-semibold text-brand-300 transition-colors hover:text-brand-400"
> >
<RotateCcw className="h-4 w-4 transition-transform group-hover:rotate-[-45deg]" /> <RotateCcw className="h-3.5 w-3.5 transition-transform group-hover:rotate-[-45deg]" />
Sync with API Sync
</button> </button>
</div> </div>
<div className="space-y-4"> <div className="space-y-1.5">
{/* Program Section */}
<HierarchySection <HierarchySection
title="Programs" title="Programs"
icon={<LayoutGrid className="h-5 w-5" />} icon={<LayoutGrid className="h-3.5 w-3.5" />}
isOpen={openSections.program} isOpen={openSections.program}
onToggle={() => toggleSection("program")} onToggle={() => toggleSection("program")}
> >
{loading.program ? ( {loading.program ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 text-brand-500 animate-spin" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
<DraggableList <DraggableList
@ -596,23 +586,22 @@ export function ContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleProgramReorder(active, over) void handleProgramReorder(active, over)
} }
icon={<LayoutGrid className="h-4 w-4" />} icon={<LayoutGrid className="h-3.5 w-3.5" />}
onEdit={(id) => handleEdit("program", id)} onEdit={(id) => handleEdit("program", id)}
onDelete={(id) => handleDelete("program", id)} onDelete={(id) => handleDelete("program", id)}
/> />
)} )}
</HierarchySection> </HierarchySection>
{/* Course Section */}
<HierarchySection <HierarchySection
title="Courses" title="Courses"
icon={<BookOpen className="h-5 w-5" />} icon={<BookOpen className="h-3.5 w-3.5" />}
isOpen={openSections.course} isOpen={openSections.course}
onToggle={() => toggleSection("course")} onToggle={() => toggleSection("course")}
> >
{loading.course ? ( {loading.course ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 text-brand-500 animate-spin" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
programs.map((program) => { programs.map((program) => {
@ -621,8 +610,8 @@ export function ContentHierarchyList() {
); );
if (programCourses.length === 0) return null; if (programCourses.length === 0) return null;
return ( return (
<div key={program.id} className="mb-4 last:mb-0"> <div key={program.id} className="mb-2 last:mb-0">
<h4 className="text-[12px] font-bold text-grayScale-400 uppercase tracking-wider mb-2 px-1"> <h4 className="mb-1 px-0.5 text-[10px] font-bold uppercase tracking-wide text-grayScale-400">
{program.name} {program.name}
</h4> </h4>
<DraggableList <DraggableList
@ -630,7 +619,7 @@ export function ContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleCourseReorder(program.id, active, over) void handleCourseReorder(program.id, active, over)
} }
icon={<BookOpen className="h-4 w-4" />} icon={<BookOpen className="h-3.5 w-3.5" />}
onEdit={(id) => handleEdit("course", id)} onEdit={(id) => handleEdit("course", id)}
onDelete={(id) => handleDelete("course", id)} onDelete={(id) => handleDelete("course", id)}
/> />
@ -640,16 +629,15 @@ export function ContentHierarchyList() {
)} )}
</HierarchySection> </HierarchySection>
{/* Module Section */}
<HierarchySection <HierarchySection
title="Modules" title="Modules"
icon={<Layers className="h-5 w-5" />} icon={<Layers className="h-3.5 w-3.5" />}
isOpen={openSections.module} isOpen={openSections.module}
onToggle={() => toggleSection("module")} onToggle={() => toggleSection("module")}
> >
{loading.module ? ( {loading.module ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 text-brand-500 animate-spin" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
courses.map((course) => { courses.map((course) => {
@ -658,8 +646,8 @@ export function ContentHierarchyList() {
); );
if (courseModules.length === 0) return null; if (courseModules.length === 0) return null;
return ( return (
<div key={course.id} className="mb-4 last:mb-0"> <div key={course.id} className="mb-2 last:mb-0">
<h4 className="text-[12px] font-bold text-grayScale-400 uppercase tracking-wider mb-2 px-1"> <h4 className="mb-1 px-0.5 text-[10px] font-bold uppercase tracking-wide text-grayScale-400">
{course.name} {course.name}
</h4> </h4>
<DraggableList <DraggableList
@ -667,7 +655,7 @@ export function ContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleModuleReorder(course.id, active, over) void handleModuleReorder(course.id, active, over)
} }
icon={<Layers className="h-4 w-4" />} icon={<Layers className="h-3.5 w-3.5" />}
onEdit={(id) => handleEdit("module", id)} onEdit={(id) => handleEdit("module", id)}
onDelete={(id) => handleDelete("module", id)} onDelete={(id) => handleDelete("module", id)}
/> />
@ -677,16 +665,15 @@ export function ContentHierarchyList() {
)} )}
</HierarchySection> </HierarchySection>
{/* Lesson Section */}
<HierarchySection <HierarchySection
title="Lessons" title="Lessons"
icon={<PlayCircle className="h-5 w-5" />} icon={<PlayCircle className="h-3.5 w-3.5" />}
isOpen={openSections.lesson} isOpen={openSections.lesson}
onToggle={() => toggleSection("lesson")} onToggle={() => toggleSection("lesson")}
> >
{loading.lesson ? ( {loading.lesson ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 text-brand-500 animate-spin" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
modules.map((module) => { modules.map((module) => {
@ -695,8 +682,8 @@ export function ContentHierarchyList() {
); );
if (moduleLessons.length === 0) return null; if (moduleLessons.length === 0) return null;
return ( return (
<div key={module.id} className="mb-4 last:mb-0"> <div key={module.id} className="mb-2 last:mb-0">
<h4 className="text-[12px] font-bold text-grayScale-400 uppercase tracking-wider mb-2 px-1"> <h4 className="mb-1 px-0.5 text-[10px] font-bold uppercase tracking-wide text-grayScale-400">
{module.name} {module.name}
</h4> </h4>
<DraggableList <DraggableList
@ -704,7 +691,7 @@ export function ContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleLessonReorder(module.id, active, over) void handleLessonReorder(module.id, active, over)
} }
icon={<PlayCircle className="h-4 w-4" />} icon={<PlayCircle className="h-3.5 w-3.5" />}
onEdit={(id) => handleEdit("lesson", id)} onEdit={(id) => handleEdit("lesson", id)}
onDelete={(id) => handleDelete("lesson", id)} onDelete={(id) => handleDelete("lesson", id)}
/> />

View File

@ -250,63 +250,63 @@ export function ExamPrepContentHierarchyList() {
} }
return ( return (
<div className="mb-8 rounded-2xl border border-grayScale-100 bg-[#ffffff] p-6 shadow-sm"> <div className="mb-4 rounded-xl border border-grayScale-100 bg-white p-3 shadow-sm">
<div className="mb-6 flex items-center justify-between"> <div className="mb-3 flex items-center justify-between gap-3">
<div> <div className="min-w-0">
<h3 className="text-[16px] font-bold text-grayScale-900"> <h3 className="text-sm font-bold text-grayScale-900">
Exam prep hierarchy Duolingo/IELTS hierarchy
</h3> </h3>
<p className="mt-1 text-[12px] text-grayScale-500"> <p className="text-[11px] text-grayScale-500">
Catalog courses, units, modules, and lessons (IELTS, Duolingo, etc.) Drag items to reorder catalog courses, units, modules, and lessons
</p> </p>
</div> </div>
<button <button
type="button" type="button"
onClick={() => void fetchHierarchy()} onClick={() => void fetchHierarchy()}
className="group flex items-center gap-2 text-[13px] font-bold text-brand-300 transition-colors hover:text-brand-400" className="group flex shrink-0 items-center gap-1.5 text-xs font-semibold text-brand-300 transition-colors hover:text-brand-400"
> >
<RotateCcw className="h-4 w-4 transition-transform group-hover:rotate-[-45deg]" /> <RotateCcw className="h-3.5 w-3.5 transition-transform group-hover:rotate-[-45deg]" />
Sync with API Sync
</button> </button>
</div> </div>
<div className="space-y-4"> <div className="space-y-1.5">
<HierarchySection <HierarchySection
title="Catalog courses" title="Catalog courses"
icon={<GraduationCap className="h-5 w-5" />} icon={<GraduationCap className="h-3.5 w-3.5" />}
isOpen={openSections.catalogCourse} isOpen={openSections.catalogCourse}
onToggle={() => toggleSection("catalogCourse")} onToggle={() => toggleSection("catalogCourse")}
> >
{loading.catalogCourse ? ( {loading.catalogCourse ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 animate-spin text-brand-500" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
<DraggableList <DraggableList
items={catalogCourses} items={catalogCourses}
onReorder={(active, over) => void handleCatalogCourseReorder(active, over)} onReorder={(active, over) => void handleCatalogCourseReorder(active, over)}
icon={<GraduationCap className="h-4 w-4" />} icon={<GraduationCap className="h-3.5 w-3.5" />}
/> />
)} )}
</HierarchySection> </HierarchySection>
<HierarchySection <HierarchySection
title="Units" title="Units"
icon={<BookOpen className="h-5 w-5" />} icon={<BookOpen className="h-3.5 w-3.5" />}
isOpen={openSections.unit} isOpen={openSections.unit}
onToggle={() => toggleSection("unit")} onToggle={() => toggleSection("unit")}
> >
{loading.unit ? ( {loading.unit ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 animate-spin text-brand-500" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
catalogCourses.map((course) => { catalogCourses.map((course) => {
const courseUnits = units.filter((u) => u.catalogCourseId === course.id) const courseUnits = units.filter((u) => u.catalogCourseId === course.id)
if (courseUnits.length === 0) return null if (courseUnits.length === 0) return null
return ( return (
<div key={course.id} className="mb-4 last:mb-0"> <div key={course.id} className="mb-2 last:mb-0">
<h4 className="mb-2 px-1 text-[12px] font-bold uppercase tracking-wider text-grayScale-400"> <h4 className="mb-1 px-0.5 text-[10px] font-bold uppercase tracking-wide text-grayScale-400">
{course.name} {course.name}
</h4> </h4>
<DraggableList <DraggableList
@ -314,7 +314,7 @@ export function ExamPrepContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleUnitReorder(course.id, active, over) void handleUnitReorder(course.id, active, over)
} }
icon={<BookOpen className="h-4 w-4" />} icon={<BookOpen className="h-3.5 w-3.5" />}
/> />
</div> </div>
) )
@ -324,21 +324,21 @@ export function ExamPrepContentHierarchyList() {
<HierarchySection <HierarchySection
title="Modules" title="Modules"
icon={<Layers className="h-5 w-5" />} icon={<Layers className="h-3.5 w-3.5" />}
isOpen={openSections.module} isOpen={openSections.module}
onToggle={() => toggleSection("module")} onToggle={() => toggleSection("module")}
> >
{loading.module ? ( {loading.module ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 animate-spin text-brand-500" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
units.map((unit) => { units.map((unit) => {
const unitModules = modules.filter((m) => m.unitId === unit.id) const unitModules = modules.filter((m) => m.unitId === unit.id)
if (unitModules.length === 0) return null if (unitModules.length === 0) return null
return ( return (
<div key={unit.id} className="mb-4 last:mb-0"> <div key={unit.id} className="mb-2 last:mb-0">
<h4 className="mb-2 px-1 text-[12px] font-bold uppercase tracking-wider text-grayScale-400"> <h4 className="mb-1 px-0.5 text-[10px] font-bold uppercase tracking-wide text-grayScale-400">
{unit.name} {unit.name}
</h4> </h4>
<DraggableList <DraggableList
@ -346,7 +346,7 @@ export function ExamPrepContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleModuleReorder(unit.id, active, over) void handleModuleReorder(unit.id, active, over)
} }
icon={<Layers className="h-4 w-4" />} icon={<Layers className="h-3.5 w-3.5" />}
/> />
</div> </div>
) )
@ -356,21 +356,21 @@ export function ExamPrepContentHierarchyList() {
<HierarchySection <HierarchySection
title="Lessons" title="Lessons"
icon={<PlayCircle className="h-5 w-5" />} icon={<PlayCircle className="h-3.5 w-3.5" />}
isOpen={openSections.lesson} isOpen={openSections.lesson}
onToggle={() => toggleSection("lesson")} onToggle={() => toggleSection("lesson")}
> >
{loading.lesson ? ( {loading.lesson ? (
<div className="flex items-center justify-center py-8"> <div className="flex items-center justify-center py-4">
<Loader2 className="h-6 w-6 animate-spin text-brand-500" /> <Loader2 className="h-5 w-5 animate-spin text-brand-500" />
</div> </div>
) : ( ) : (
modules.map((module) => { modules.map((module) => {
const moduleLessons = lessons.filter((l) => l.moduleId === module.id) const moduleLessons = lessons.filter((l) => l.moduleId === module.id)
if (moduleLessons.length === 0) return null if (moduleLessons.length === 0) return null
return ( return (
<div key={module.id} className="mb-4 last:mb-0"> <div key={module.id} className="mb-2 last:mb-0">
<h4 className="mb-2 px-1 text-[12px] font-bold uppercase tracking-wider text-grayScale-400"> <h4 className="mb-1 px-0.5 text-[10px] font-bold uppercase tracking-wide text-grayScale-400">
{module.name} {module.name}
</h4> </h4>
<DraggableList <DraggableList
@ -378,7 +378,7 @@ export function ExamPrepContentHierarchyList() {
onReorder={(active, over) => onReorder={(active, over) =>
void handleLessonReorder(module.id, active, over) void handleLessonReorder(module.id, active, over)
} }
icon={<PlayCircle className="h-4 w-4" />} icon={<PlayCircle className="h-3.5 w-3.5" />}
/> />
</div> </div>
) )