assets and tier plans revamp

This commit is contained in:
rgrgogu
2026-08-01 17:44:12 +08:00
parent 4f738a691d
commit a34c6feb84
45 changed files with 2172 additions and 273 deletions
@@ -10,6 +10,7 @@ import {
import { useAssets } from "@/contexts/AdminAssetsContext";
import { useUploadQueue } from "@/contexts/UploadQueueContext";
import { useAuth } from "@/contexts/AuthContext";
import { formatFileSize } from "@/utils/format.util";
import { Button } from "@/components/ui/button";
import { Progress } from "@/components/ui/progress";
import {
@@ -29,12 +30,6 @@ function FileTypeIcon({ mime = "" }) {
return <FileText className="h-8 w-8 text-orange-400 shrink-0" />;
}
function formatSize(bytes = 0) {
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}
// ─── Drop zone ────────────────────────────────────────────────────────────────
function DropZone({ onFiles }) {
@@ -93,7 +88,7 @@ function FileRow({ job, onRetry, onRemove }) {
<div className="flex-1 min-w-0 space-y-1.5">
<div className="flex items-center justify-between gap-2">
<p className="text-sm font-medium truncate">{job.name}</p>
<span className="text-xs text-muted-foreground shrink-0">{formatSize(job.size)}</span>
<span className="text-xs text-muted-foreground shrink-0">{formatFileSize(job.size)}</span>
</div>
<Progress value={job.progress} className={barClass} />
<div className="flex items-center gap-1.5 text-xs">