import React from 'react' interface ReadingProgressIndicatorProps { progress: number // 0 to 100 isComplete?: boolean showPercentage?: boolean className?: string isSidebarCollapsed?: boolean isHighlightsCollapsed?: boolean } export const ReadingProgressIndicator: React.FC = ({ progress, isComplete = false, showPercentage = true, className = '', isSidebarCollapsed = false, isHighlightsCollapsed = false }) => { const clampedProgress = Math.min(100, Math.max(0, progress)) // Determine reading state based on progress (matching readingProgressUtils.ts logic) const progressDecimal = clampedProgress / 100 const isStarted = progressDecimal > 0 && progressDecimal <= 0.10 // Determine bar color based on state let barColorClass = '' let barColorStyle: string | undefined = 'var(--color-primary)' // Default blue if (isComplete) { barColorClass = 'bg-green-500' barColorStyle = undefined } else if (isStarted) { barColorStyle = 'var(--color-text)' // Neutral text color (matches card titles) } // Calculate left and right offsets based on sidebar states (desktop only) const leftOffset = isSidebarCollapsed ? 'var(--sidebar-collapsed-width)' : 'var(--sidebar-width)' const rightOffset = isHighlightsCollapsed ? 'var(--highlights-collapsed-width)' : 'var(--highlights-width)' return (
{showPercentage && (
{isComplete ? '✓' : `${clampedProgress}%`}
)}
) }