fix: ui fixes in transcript listing for books
This commit is contained in:
@@ -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)),
|
||||
})),
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user