// Everything you have marked in the Bible: highlights (grouped and filtered by colour, each colour // named by you — "Promises", "Commands") and bookmarks. Opens from the bookmark button in the top bar. import { useState } from 'react'; import Sheet from './Sheet.jsx'; import { CloseIcon } from './icons.jsx'; import { COLOR_NAMES, COLOR_SUGGESTIONS, HIGHLIGHT_COLORS, colorTitle } from '../../utils/highlightColors.js'; const tabBtn = (active) => `rounded-full border px-3 py-1 text-xs font-medium ${active ? 'border-[var(--r-text)] bg-[var(--r-text)] text-[var(--r-bg)]' : 'border-[var(--r-line)] text-[var(--r-sub)] hover:bg-black/5'}`; export default function MarksSheet({ open, onClose, bookmarks, highlights, colorLabels, onSetLabel, onJump, onRemoveBookmark, onRemoveHighlight, }) { const [tab, setTab] = useState('highlights'); const [filter, setFilter] = useState(null); // a highlight colour, or null for all const [editing, setEditing] = useState(false); const counts = Object.fromEntries(HIGHLIGHT_COLORS.map((c) => [c, highlights.filter((h) => h.color === c).length])); const shown = filter ? highlights.filter((h) => h.color === filter) : highlights; // Colours in use that aren't one of the picker's (older data) still get listed const total = highlights.length + bookmarks.length; return (
{tab === 'highlights' && ( <> {/* Colour key: tap a colour to show only that one; "Name colours" lets you say what each means */}
{HIGHLIGHT_COLORS.map((c) => ( ))}
{editing && (
{HIGHLIGHT_COLORS.map((c) => ( ))}
)} {highlights.length === 0 ? (

No highlights yet. Select some words in a verse and pick a colour to save them here.

) : shown.length === 0 ? (

Nothing highlighted in that colour yet.

) : shown.map((h) => (
))} )} {tab === 'bookmarks' && ( bookmarks.length === 0 ? (

No bookmarks yet. Tap a verse, then the bookmark icon, to save it here.

) : bookmarks.map((e) => (
)) )}
); }