"use client"; export default function ProgressBar({ documents, selectedDocIndex, currentDoc, pageIdx, currentPageDatasets, annotatorName, }) { if (!documents || documents.length === 0) return null; // 1. PDF progress: which doc out of total const docPosition = documents.findIndex(d => d.index === selectedDocIndex) + 1; const totalDocs = documents.length; // 2. Page progress: which page out of annotatable pages in current doc const totalPages = currentDoc?.annotatable_pages?.length ?? 0; const currentPage = totalPages > 0 ? pageIdx + 1 : 0; // 3. Mentions progress: verified by CURRENT USER vs total on current page const totalMentions = currentPageDatasets?.length ?? 0; const verifiedMentions = currentPageDatasets?.filter(ds => { const myValidation = (ds.validations || []).find(v => v.annotator === annotatorName); return myValidation?.human_validated === true; }).length ?? 0; return (