// Right-hand pane of the Study stage: commentary, word study, cross-references and // people & places, all driven by the selected chunk. import { useState } from 'react'; import CommentaryChunkTab from './CommentaryChunkTab.jsx'; import WordStudyTab from './WordStudyTab.jsx'; import CrossRefsTab from './CrossRefsTab.jsx'; import PeopleChunkTab from './PeopleChunkTab.jsx'; import IqChunkAids from '../iq/IqChunkAids.jsx'; import { useIqAvailable } from '../../hooks/useIq.js'; export const RESOURCE_TABS = [ { id: 'commentary', label: 'Commentary' }, { id: 'words', label: 'Word study' }, { id: 'refs', label: 'Cross-refs' }, { id: 'people', label: 'People & places' }, { id: 'aids', label: 'Study aids', needsIq: true }, // shown only when the server has an IQ Bible key ]; export default function ResourcePane({ tab, setTab, chunk, chapter, chapterIndex, project, updateChunk, notify, resources, wordStudy, crossRefs, openWordId, setOpenWordId }) { const iq = useIqAvailable(); const tabs = RESOURCE_TABS.filter((t) => !t.needsIq || iq); if (tab === 'aids' && !iq) tab = 'commentary'; const counts = { words: chunk.greekWords.length, refs: (chunk.crossReferences ?? []).length }; return (