bolt.diy/app/components/ui/Progress.tsx

23 lines
676 B
TypeScript
Raw Normal View History

2025-01-24 15:14:48 +00:00
import * as React from 'react';
import { classNames } from '~/utils/classNames';
2025-01-24 15:14:48 +00:00
interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
value?: number;
}
const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(({ className, value, ...props }, ref) => (
<div
2025-01-24 15:14:48 +00:00
ref={ref}
className={classNames('relative h-2 w-full overflow-hidden rounded-full bg-bolt-elements-background', className)}
2025-01-24 15:14:48 +00:00
{...props}
>
<div
className="h-full w-full flex-1 bg-bolt-elements-textPrimary transition-all"
2025-01-24 15:14:48 +00:00
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</div>
2025-01-24 15:14:48 +00:00
));
Progress.displayName = 'Progress';
2025-01-24 15:14:48 +00:00
export { Progress };