/** * ProRank Progress Bar * * Simple progress indicator used across dashboards. */ import * as React from 'react'; export interface ProrankProgressBarProps extends React.HTMLAttributes { value: number; max?: number; barClassName?: string; showLabel?: boolean; } export const ProrankProgressBar: React.FC = ({ value, max = 100, className = '', barClassName = '', showLabel = false, ...props }) => { const safeMax = max > 0 ? max : 100; const percent = Math.max(0, Math.min(100, (Number(value) / safeMax) * 100)); return (
{showLabel ? (
{Math.round(percent)}%
) : null}
); }; export default ProrankProgressBar;