mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
assets and tier plans revamp
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user