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