Files
OpenFrame/components/ui/progress.tsx
T
Yusuf İpek 873945464d feat: implement storage quota management for uploads
- Added storage quota enforcement for audio and image uploads in the respective routes.
- Introduced reservation system to manage concurrent uploads and prevent quota overages.
- Enhanced comment creation to account for audio and image attachment sizes against user quotas.
- Created new UploadReservation model to track in-flight upload reservations.
- Backfilled existing video assets with size information from R2.
- Added progress component for UI feedback during uploads.
- Updated API responses to include reservation IDs for better quota management.
- Adjusted error handling to return appropriate storage limit exceeded messages.
2026-04-15 19:53:43 +03:00

24 lines
517 B
TypeScript

import { cn } from '@/lib/utils';
function Progress({
value = 0,
className,
...props
}: React.ComponentProps<'div'> & { value?: number }) {
const clamped = Math.min(100, Math.max(0, value));
return (
<div
data-slot="progress"
className={cn('relative h-2 w-full overflow-hidden rounded-full bg-muted', className)}
{...props}
>
<div
className="h-full bg-primary transition-all"
style={{ width: `${clamped}%` }}
/>
</div>
);
}
export { Progress };