import type { ProgressProps } from "$/types/ProgressTypes"; import clsx from "clsx"; import { forwardRef, useMemo } from "react"; const Progress = forwardRef(({ id, className, value, min, max, size = "md", rounding = "full", label, tabIndex, progressColor, backgroundColor }, ref ) => { const percentage = useMemo(() => { const num = !value || Number.isNaN(value) ? min : Math.max(value, min); const den = (!value || Number.isNaN(value) ? max : Math.max(value, max)) - min; const percentage = (num / den) * 100; return percentage && percentage > max ? max : percentage; }, [ min, max, value ]); return (
); }); Progress.displayName = "Progress"; export default Progress;