// The prayer journal: what you are praying about (and for whom), the verses tied to each request, the days you // prayed, and the answers when they come. import { useEffect, useMemo, useRef, useState } from 'react'; import { useApp } from '../context/AppContext.js'; import PageShell from '../components/study/PageShell.jsx'; import { useToast } from '../components/Toasts.jsx'; import { STATUSES, filterPrayers, daysToAnswer, labelFor, live, parsePrayerImport, parseVerses, pinned as pinnedList, prayersToJson, prayersToMarkdown } from '../utils/prayers.js'; import { localDateString } from '../utils/readingPlans.js'; const field = 'rounded-xl border border-[var(--r-line)] bg-[var(--r-bg)] px-3 py-2 text-sm text-[var(--r-text)] focus:outline-none focus:ring-2 focus:ring-[var(--r-line)]'; const small = 'rounded-lg border border-[var(--r-line)] px-2.5 py-1 text-xs hover:bg-black/5'; const tabBtn = (on) => `rounded-full border px-3 py-1 text-xs font-medium ${on ? 'border-[var(--r-text)] bg-[var(--r-text)] text-[var(--r-bg)]' : 'border-[var(--r-line)] text-[var(--r-sub)] hover:bg-black/5'}`; function VerseChips({ verses, onOpen }) { if (!verses?.length) return null; return ( {verses.map((v, i) => ( ))} ); } function PrayerCard({ prayer, today, actions, onOpenVerse, pinPos }) { const [mode, setMode] = useState(null); // null | 'edit' | 'answer' | 'partial' const [text, setText] = useState(''); const [note, setNote] = useState(''); const prayedToday = prayer.prayedOn.includes(today); const isPinned = !!pinPos; const days = daysToAnswer(prayer); return (
  • {mode === 'edit' ? (