diff --git a/app/[locale]/(backend)/lib/dailyVerseData.ts b/app/[locale]/(backend)/lib/dailyVerseData.ts new file mode 100644 index 0000000..018d429 --- /dev/null +++ b/app/[locale]/(backend)/lib/dailyVerseData.ts @@ -0,0 +1,32 @@ +// Local data storage for development without DB +// Each object represents a verse for a specific day +export interface localizedContent { + en: string; + de: string; + ru: string; +} + +export interface BibleVerse { + reference: string; + content: localizedContent; +} + +export const bibleVerses: BibleVerse[] = [ + { + reference: "Epheser 2:19", + content: { + en: "So then you are no longer strangers and aliens...", + de: "So seid ihr nun nicht mehr Gäste und Fremdlinge...", + ru: "Итак вы уже не чужие и не пришельцы..." + } + }, + { + reference: "Psalm 23:1", + content: { + en: "The Lord is my shepherd...", + de: "Der Herr ist mein Hirte...", + ru: "Господь — Пастырь мой..." + } + }, + // Add as many as you want here +]; \ No newline at end of file diff --git a/app/[locale]/(backend)/page.tsx b/app/[locale]/(backend)/page.tsx index 1029ffb..a4dbec6 100644 --- a/app/[locale]/(backend)/page.tsx +++ b/app/[locale]/(backend)/page.tsx @@ -22,11 +22,26 @@ import { Users, } from "lucide-react"; import { useTranslations } from "next-intl"; +import { useParams } from "next/navigation"; import Link from "next/link"; import React from "react"; +import { bibleVerses, localizedContent } from "./lib/dailyVerseData"; const Dashboard: React.FC = () => { + // 1. Get a unique number for the current day + const today = new Date(); + today.setHours(0, 0, 0, 0); // Normalize to midnight + const dayTimestamp = today.getTime(); + + // 2. Use the timestamp to get a consistent index + // The modulo (%) operator ensures the index is always within array bounds + const verseIndex = dayTimestamp % bibleVerses.length; + const todayVerse = bibleVerses[verseIndex]; + const params = useParams(); + const lng = params.locale as keyof localizedContent || "en"; // Default to English if no locale is provided + const t = useTranslations("dashboard"); + const categories: ModuleCategory[] = [ { title: "People & Community", @@ -174,7 +189,12 @@ const Dashboard: React.FC = () => {
{t("welcome")}
+{t("greeting", { user: "David", church: "Rastatt" })}
+{t("verse_intro")}
++ „{todayVerse.content[lng]}" +
+ ({todayVerse.reference})