fix: ui fixes in transcript listing for books

This commit is contained in:
gosangam
2026-06-17 14:14:45 +05:30
parent fc2aef0c3d
commit bc1798b31b
2 changed files with 20 additions and 2 deletions
@@ -8,7 +8,7 @@ import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { ChevronLeft, ChevronRight, Menu, Calendar, Clock, MapPin } from "lucide-react";
import { PlayAudioButton } from "@/app/(app)/transcriptions/[slug]/play-audio-button";
import { parseChapter } from "@/lib/book-reference";
import { parseChapter, parseVerse } from "@/lib/book-reference";
import {
Drawer,
DrawerClose,
@@ -105,7 +105,11 @@ function buildSections(
.map(([k, v]) => ({
key: k,
label: v.label,
transcriptions: v.items,
// Order lectures by verse ascending (e.g. 2.1, 2.3, 2.4…),
// irrespective of year. Stable sort keeps year order within a verse.
transcriptions: v.items
.slice()
.sort((a, b) => parseVerse(a.reference) - parseVerse(b.reference)),
})),
}));
}