// 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'; export const RESOURCE_TABS = [ { id: 'commentary', label: 'Commentary' }, { id: 'words', label: 'Word study' }, { id: 'refs', label: 'Cross-refs' }, { id: 'people', label: 'People & places' }, ]; export default function ResourcePane({ tab, setTab, chunk, chapter, chapterIndex, project, updateChunk, notify, resources, wordStudy, crossRefs, openWordId, setOpenWordId }) { const counts = { words: chunk.greekWords.length, refs: (chunk.crossReferences ?? []).length }; return (
{RESOURCE_TABS.map((t) => ( ))}
{tab === 'commentary' && } {tab === 'words' && } {tab === 'refs' && } {tab === 'people' && }
); } export function useResourceTab() { const [tab, setTabState] = useState(() => { try { const saved = localStorage.getItem('studyResourceTab'); return RESOURCE_TABS.some((t) => t.id === saved) ? saved : 'commentary'; } catch { return 'commentary'; } }); const setTab = (id) => { setTabState(id); try { localStorage.setItem('studyResourceTab', id); } catch { /* storage unavailable */ } }; return [tab, setTab]; }