import { cn } from '@/lib/utils'; interface Milestone { target: number; description: string; created_at: string; } interface ProgressBarProps { currentShares: number; milestones: Milestone[]; selectedMilestoneIndex?: number; className?: string; onClick?: () => void; } export default function ProgressBar({ currentShares, milestones, selectedMilestoneIndex = 0, className, onClick }: ProgressBarProps) { // Get the selected milestone for progress calculation const selectedMilestone = milestones.length > 0 && selectedMilestoneIndex < milestones.length ? milestones[selectedMilestoneIndex] : null; // Calculate progress percentage const progressPercentage = selectedMilestone ? Math.min((currentShares / selectedMilestone.target) * 100, 100) : 0; return (
{/* Progress Bar Container */}
{/* Old-school progress bar with overlaid text */}
{/* Inner container */}
{/* Progress fill */}
{/* Text overlay */} {selectedMilestone && (
{/* Base text (red on black background) */}
{progressPercentage.toFixed(1)}%
)}
); }