// Compare two passages side by side — your notes and the verses — for parallels (the Gospels), repeated themes, // or the same chapter studied twice. Pick any chunk from any of your studies to set beside the one you're on. import { useEffect, useMemo, useRef, useState } from 'react'; import { useApp } from '../../context/AppContext.js'; import { loadProjectById } from '../../utils/projectStorage.js'; import { formatChunkReference, getChunkVerseEntries } from '../../utils/bibleUtils.jsx'; import { READER_TRANSLATIONS, fetchChapter, translationName } from '../../utils/bibleText.js'; import { alignVerses, differencesFor, markRanges, translationSpans } from '../../utils/compareTranslations.js'; import { ownShare, pastedWords } from '../../utils/ownWork.js'; import { usePasteCheck } from './PastePrompt.jsx'; const FIELDS = [['observation', 'Observe'], ['interpretation', 'Interpret'], ['application', 'Apply']]; // Every chunk in your studies, as a pick-list entry that remembers where it sits. function choices(projectIndex, currentProject) { const projects = projectIndex.map((e) => (e.id === currentProject?.id ? currentProject : loadProjectById(e.id))).filter(Boolean); return projects.flatMap((project) => project.chapters.flatMap((chapter, chapterIndex) => chapter.chunks.map((chunk) => ({ key: `${project.id}:${chunk.id}`, project, chapterIndex, chunk, label: `${formatChunkReference(project, chapterIndex, chunk, '–')} · ${project.title}`, })))); } function Column({ entry }) { if (!entry) return

Pick a passage to compare.

; const verses = getChunkVerseEntries(entry.project, entry.chapterIndex, entry.chunk); return (

{entry.label}

{verses.map((v) =>

{v.number}{v.text}

)}
{FIELDS.map(([f, label]) => (

{label}

{entry.chunk[f]?.trim() || Nothing written.}

))}
); } const OIA = [ ['observation', 'Observe', 'What does the text say?'], ['interpretation', 'Interpret', 'What does it mean?'], ['application', 'Apply', 'What do I do with it?'], ]; // The chunk's own Observe / Interpret / Apply notes, editable right here while the translations are side by side. // They are the same notes as on the Study page, and long pastes are tagged the same way. function OiaBoxes({ chunk, updateChunk }) { const share = ownShare(chunk); const pasteCheck = usePasteCheck(chunk, updateChunk); return (

Your notes{share !== null ? ` · ${share}% your own words` : ''}

{OIA.map(([field, label, hint]) => { const pasted = pastedWords(chunk, field); return (