// A reading list for the whole study: the books, commentaries and articles you plan to consult, with a note on // each and a tick when done. It belongs to the study, not one chunk. import { makeId } from '../../utils/bibleUtils.jsx'; export default function ReadingListTab({ project, updateProject }) { const items = project?.readingList ?? []; const set = (next) => updateProject((current) => ({ ...current, readingList: next(current.readingList ?? []) })); const add = (title) => { const t = title.trim(); if (t) set((list) => [...list, { id: makeId(), title: t, note: '', done: false }]); }; const patch = (id, change) => set((list) => list.map((i) => (i.id === id ? { ...i, ...change } : i))); const open = items.filter((i) => !i.done).length; return (
Books and articles to consult for this study{items.length ? ` · ${open} to read, ${items.length - open} done` : ''}. Read the passage and write your own notes first; this list is for afterwards.