// The Study page's "Study aids" tab: IQ Bible's aids for a verse of the chunk being studied (the first by // default). Topics can be added to the chunk as tags with one tap. import { useState } from 'react'; import IqStudyAids from './IqStudyAids.jsx'; export default function IqChunkAids({ chunk, chapter, updateChunk, notify }) { const [picked, setPicked] = useState(null); const last = Math.min(chunk.endVerse, chunk.startVerse + 59); const verse = picked != null && picked >= chunk.startVerse && picked <= last ? picked : chunk.startVerse; const verses = Array.from({ length: last - chunk.startVerse + 1 }, (_, i) => chunk.startVerse + i); const addTag = (name) => { const tags = chunk.tags ?? []; if (tags.some((t) => t.toLowerCase() === name.toLowerCase())) { notify(`“${name}” is already a tag.`, 1600); return; } updateChunk(chunk.id, { tags: [...tags, name] }); notify(`Added the tag “${name}”.`, 1600); }; return (