SurfSense/surfsense_web/components/ui/progress.tsx

27 lines
642 B
TypeScript
Raw Normal View History

2025-07-27 10:05:37 -07:00
"use client";
2025-06-09 15:50:15 -07:00
2025-07-27 10:05:37 -07:00
import * as React from "react";
import { cn } from "@/lib/utils";
2025-06-09 15:50:15 -07:00
interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
2025-07-27 10:05:37 -07:00
value?: number;
2025-06-09 15:50:15 -07:00
}
const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(
2025-07-27 10:05:37 -07:00
({ className, value = 0, ...props }, ref) => (
<div
ref={ref}
className={cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)}
{...props}
>
<div
className="h-full bg-primary transition-all duration-300 ease-in-out"
style={{ width: `${Math.min(100, Math.max(0, value))}%` }}
/>
</div>
)
);
Progress.displayName = "Progress";
2025-06-09 15:50:15 -07:00
2025-07-27 10:05:37 -07:00
export { Progress };