fix: bg verses now show range of verses

This commit is contained in:
gosangam
2026-04-14 14:46:16 +05:30
parent 82b6685c97
commit 83fec22f53
37 changed files with 151 additions and 86 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
type VerseEntry = {
verse: number;
verse_end?: number;
reference: string;
};
@@ -27,7 +28,7 @@ export function VerseIndex({
}
}
},
{ rootMargin: "-20% 0px -60% 0px" }
{ rootMargin: "-20% 0px -60% 0px" },
);
const articles = document.querySelectorAll("article[id^='verse-']");
@@ -52,7 +53,7 @@ export function VerseIndex({
: "text-zinc-600 dark:text-zinc-400 hover:bg-amber-100 dark:hover:bg-zinc-800 hover:text-zinc-900 dark:hover:text-zinc-200"
}`}
>
{v.verse}
{v.verse_end ? `${v.verse}–${v.verse_end}` : v.verse}
</a>
))}
</nav>