// A verse's "study aids" from IQ Bible: chapter overview, topics, places, people, textual notes, Gospel
// parallels and timeline. Each section loads only when opened, so nothing is spent on what isn't read.
import { useState } from 'react';
import { useIq } from '../../hooks/useIq.js';
import { listOf } from '../../utils/iqbible.js';
const muted = 'text-xs text-[var(--r-sub,#64748b)]';
const GOSPELS = ['MAT', 'MRK', 'LUK', 'JHN'];
function Aid({ title, path, query, children, empty = 'Nothing recorded here.' }) {
const [open, setOpen] = useState(false);
const { status, data, error } = useIq(open ? path : null, query);
return (
Loading… {error} {empty}{title}
Loading…
; if (!p) returnNo profile.
; return ({p.brief || p.briefest || p.description}
{p.tribe_nation &&{p.tribe_nation}
} {p.first_appearance &&First appears {p.first_appearance.book} {p.first_appearance.chapter}:{p.first_appearance.verse}
}{v.title}
{v.traditional_reading &&Traditional (KJV/TR): {v.traditional_reading}
} {v.critical_reading &&Critical text: {v.critical_reading}
} {v.explanation &&{v.explanation}
}§{s.number} {String(s.title ?? '').toLowerCase().replace(/(^|[.\s])([a-z])/g, (m, a, b) => a + b.toUpperCase())}
{(s.references ?? []).map((r) => r.citation ?? r).join(' · ')}
{d.summary}
{d.source_author &&{d.source_author}{d.source_year ? `, ${d.source_year}` : ''}
} > )}{d.placement ?? `${d.date ?? ''}`}
{d.preceding?.length > 0 &&Before: {d.preceding.map((e) => `${e.event} (${e.date})`).join('; ')}
} {d.following?.length > 0 &&After: {d.following.map((e) => `${e.event} (${e.date})`).join('; ')}
} > )}Study aids via IQ Bible.