IQ Bible on the Study side: commentaries, lexicons, study aids, outline
Build and Push Docker Image / build-and-push (push) Failing after 19s
Build and Push Docker Image / build-and-push (push) Failing after 19s
- Commentary tab: "More sources" switch with notes for the whole chunk and "Add to notes" quoting - Word study: Lexicons button for words with a Strong's number - New "Study aids" tab (any verse of the chunk; topics add as tags) - Outline points: "Add from IQ Bible" attaches topics, Gospel parallels, manuscript notes and places Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8939a7f49f
commit
f70f1baf15
12 files changed
+281
-11
No files matched your search
@@ -3,12 +3,18 @@
|
||||
import { useState } from 'react';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { externalLookupLinks, speakOriginalWord } from '../../utils/wordStudy.js';
|
||||
import { useIqAvailable } from '../../hooks/useIq.js';
|
||||
import { normalizeStrongs } from '../../utils/iqbible.js';
|
||||
import IqLexicon from '../iq/IqLexicon.jsx';
|
||||
|
||||
const inputCls = 'mt-1 block w-full rounded-lg border border-[var(--r-line)] bg-[var(--r-bg)] px-2.5 py-1.5 text-sm text-[var(--r-text)] focus:outline-none focus:ring-2 focus:ring-[var(--r-line)]';
|
||||
const btn = 'rounded-lg border border-[var(--r-line)] px-2.5 py-1.5 text-xs hover:bg-black/5 disabled:opacity-50';
|
||||
|
||||
function WordCard({ word, open, onToggle, chunkId, wordStudy }) {
|
||||
const { updateChunkWord, lookupWord, removeGreekWord } = wordStudy;
|
||||
const iq = useIqAvailable();
|
||||
const [lexicon, setLexicon] = useState(false);
|
||||
const strongs = normalizeStrongs(word.strongNumber || word.query);
|
||||
const set = (patch) => updateChunkWord(chunkId, word.id, patch);
|
||||
const field = (label, key, placeholder) => (
|
||||
<label className="block text-xs text-[var(--r-sub)]">{label}
|
||||
@@ -25,6 +31,7 @@ function WordCard({ word, open, onToggle, chunkId, wordStudy }) {
|
||||
</button>
|
||||
{open && (
|
||||
<div className="space-y-3 border-t border-[var(--r-line)] px-3 py-3">
|
||||
{lexicon && iq && strongs && <IqLexicon strongs={strongs} onClose={() => setLexicon(false)} />}
|
||||
<label className="block text-xs text-[var(--r-sub)]">Strong’s number or English gloss
|
||||
<input type="text" value={word.query} onChange={(e) => set({ query: e.target.value })}
|
||||
onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault(); lookupWord(chunkId, word.id, 'greek'); } }}
|
||||
@@ -33,6 +40,7 @@ function WordCard({ word, open, onToggle, chunkId, wordStudy }) {
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button type="button" onClick={() => lookupWord(chunkId, word.id, 'greek')} className={`${btn} bg-[var(--r-text)] text-[var(--r-bg)] hover:opacity-90`}>{word.loading ? 'Looking up...' : 'Look up Greek'}</button>
|
||||
<button type="button" onClick={() => lookupWord(chunkId, word.id, 'hebrew')} className={btn}>{word.loading ? 'Looking up...' : 'Look up Hebrew'}</button>
|
||||
{iq && strongs && <button type="button" onClick={() => setLexicon((o) => !o)} aria-pressed={lexicon} className={btn} title="Strong's, BDB, LSJ and Abbott-Smith entries">Lexicons</button>}
|
||||
{word.lexeme && <button type="button" onClick={() => speakOriginalWord(word.lexeme, word.strongNumber)} className={btn} title="Hear pronunciation">Speak</button>}
|
||||
<button type="button" onClick={() => removeGreekWord(chunkId, word.id)} className={`${btn} ml-auto text-[var(--r-danger,#b42318)]`}>Delete</button>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user