// The chunk's passage, set like the Reader. Click a verse number to open its // interlinear words; click an original word to add it to the chunk's word study. import { useState } from 'react'; import { NT_BOOK_NUMBER } from '../../utils/bibleUtils.jsx'; import GrammarPanel from '../GrammarPanel.jsx'; import { markUnits } from '../../utils/biblicalUnits.js'; export default function ScripturePane({ verses, chapter, interlinear, interlinearLoading, addedStrongs, onPickWord, verseNotes = {}, onVerseNote }) { const [openVerse, setOpenVerse] = useState(null); const [editingNote, setEditingNote] = useState(null); const [inspect, setInspect] = useState(null); // the original word whose grammar is showing: { key, index } const isHebrew = chapter && !NT_BOOK_NUMBER[chapter.bookAbbrev]; return (
{verses.map((v) => { const words = v.chapter === chapter?.chapter ? interlinear?.[String(v.number)] : null; const open = openVerse === `${v.chapter}:${v.number}`; return (
{markUnits(v.text).map((part, i) => (part.note ? {part.text} : {part.text}))} {onVerseNote && ( )} {(verseNotes[`${v.chapter}:${v.number}`] || editingNote === `${v.chapter}:${v.number}`) && (