import * as React from "react"; import { cn } from "@/shared/lib/cn"; /** * shadcn-style progress bar (no Radix dependency). `value` is 0–100; a * `null`/`undefined` value renders an indeterminate sweep, used for phases * with no byte counts (e.g. video transcoding before the upload starts). */ const Progress = React.forwardRef< HTMLDivElement, React.HTMLAttributes & { value?: number | null } >(({ className, value, ...props }, ref) => { const clamped = typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : null; return (
{clamped === null ? (
) : (
)}
); }); Progress.displayName = "Progress"; export { Progress };