From e3b2b7ec84fdd09400d3998b6c928648b5e673e1 Mon Sep 17 00:00:00 2001
From: Justin Silvestre
Date: Fri, 1 Nov 2024 14:21:11 +0100
Subject: [PATCH] Clean up brandt index page
---
src/app/page.tsx | 53 +++++++++++++++++++++++++++++++-----------------
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/src/app/page.tsx b/src/app/page.tsx
index b14d776..29b9141 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -10,6 +10,9 @@ const GLOSSED = [
'brandt-ch05-1', 'brandt-ch05-2',
]
+// prettier-ignore
+const LESSONS_AND_TEXTS = [[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]]
+
export default function Home() {
const textsIdsAndTitles = getTextsIdsAndTitles();
return (
@@ -23,25 +26,37 @@ export default function Home() {
Passages marked with * have been transcribed but not yet glossed.
-
- {textsIdsAndTitles
- .filter((text) => text.preview)
- .map((text) => {
- const [, , brandtChapter, textNumber] = text.textId.split(/-|ch/);
- return (
- -
-
- Lesson {parseInt(brandtChapter, 10)}, Text {textNumber}
- {!GLOSSED.includes(text.textId) && "*"}
- {" - "}
- {text.preview}
-
-
- );
- })}
+
+ {LESSONS_AND_TEXTS.map((lesson, i) => {
+ const lessonNumber = i + 1;
+ return (
+ -
+
Lesson {lessonNumber}
+
+ {lesson.map((textNumber) => {
+ const textId = `brandt-ch${lessonNumber
+ .toString()
+ .padStart(2, "0")}-${textNumber}`;
+ const text = textsIdsAndTitles.find(
+ (t) => t.textId === textId
+ )!;
+ return (
+
+ {" "}
+
+ {text.preview}
+ {!GLOSSED.includes(textId) && "*"}
+
+
+ );
+ })}
+
+
+ );
+ })}
);