@geekapps/silo-elements-nextjs 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FileUploader.js +81 -80
- package/dist/FileUploader.js.map +1 -1
- package/dist/ImageUploader.js +86 -56
- package/dist/ImageUploader.js.map +1 -1
- package/dist/MediaUploader.js +253 -189
- package/dist/MediaUploader.js.map +1 -1
- package/dist/VideoUploader.js +86 -53
- package/dist/VideoUploader.js.map +1 -1
- package/dist/index.js +253 -189
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/FileUploader.js
CHANGED
|
@@ -375,6 +375,14 @@ var DEFAULT_VIDEO_OPTS = {
|
|
|
375
375
|
codec: "h264",
|
|
376
376
|
transcoding: "auto"
|
|
377
377
|
};
|
|
378
|
+
function uploadLabel(status, progress) {
|
|
379
|
+
if (status === "preparing") return "Preparando\u2026";
|
|
380
|
+
if (status === "completing") return "Concluindo\u2026";
|
|
381
|
+
if (progress < 30) return "Iniciando envio\u2026";
|
|
382
|
+
if (progress < 70) return "Enviando\u2026";
|
|
383
|
+
if (progress < 95) return "Quase l\xE1\u2026";
|
|
384
|
+
return "Finalizando\u2026";
|
|
385
|
+
}
|
|
378
386
|
function FileUploader({
|
|
379
387
|
bucket,
|
|
380
388
|
visibility = "private",
|
|
@@ -423,11 +431,8 @@ function FileUploader({
|
|
|
423
431
|
function setRename(index, name, files) {
|
|
424
432
|
setRenames((prev) => {
|
|
425
433
|
const next = new Map(prev);
|
|
426
|
-
if (name.trim() && name.trim() !== files[index]?.name)
|
|
427
|
-
|
|
428
|
-
} else {
|
|
429
|
-
next.delete(index);
|
|
430
|
-
}
|
|
434
|
+
if (name.trim() && name.trim() !== files[index]?.name) next.set(index, name.trim());
|
|
435
|
+
else next.delete(index);
|
|
431
436
|
return next;
|
|
432
437
|
});
|
|
433
438
|
}
|
|
@@ -441,8 +446,7 @@ function FileUploader({
|
|
|
441
446
|
const effectiveVideo = showVideoOptions ? videoOpts : video ?? videoOpts;
|
|
442
447
|
if (multiple && files.length > 1) {
|
|
443
448
|
try {
|
|
444
|
-
const
|
|
445
|
-
const results = await batch.upload(files, opts);
|
|
449
|
+
const results = await batch.upload(files, { ...bucket !== void 0 && { bucket }, visibility, image: effectiveImage, video: effectiveVideo });
|
|
446
450
|
onBatchUpload?.(results);
|
|
447
451
|
results.forEach((r) => onUpload?.(r));
|
|
448
452
|
} catch (err) {
|
|
@@ -452,23 +456,20 @@ function FileUploader({
|
|
|
452
456
|
const file = files[0];
|
|
453
457
|
if (!file) return;
|
|
454
458
|
try {
|
|
455
|
-
const
|
|
456
|
-
const result = await single.upload(file, opts);
|
|
459
|
+
const result = await single.upload(file, { ...bucket !== void 0 && { bucket }, visibility, image: effectiveImage, video: effectiveVideo });
|
|
457
460
|
if (result) onUpload?.(result);
|
|
458
461
|
} catch (err) {
|
|
459
462
|
onError?.(err instanceof Error ? err : new Error(String(err)));
|
|
460
463
|
}
|
|
461
464
|
}
|
|
462
|
-
}, [single, batch, multiple, bucket, visibility, image, video, onUpload, onBatchUpload, onError]);
|
|
465
|
+
}, [single, batch, multiple, bucket, visibility, image, video, imageOpts, videoOpts, showImageOptions, showVideoOptions, onUpload, onBatchUpload, onError]);
|
|
463
466
|
const handleFiles = useCallback(async (files) => {
|
|
464
467
|
const needsStaging = allowRename || showImageOptions && files.some((f) => f.type.startsWith("image/")) || showVideoOptions && files.some((f) => f.type.startsWith("video/"));
|
|
465
468
|
if (needsStaging) {
|
|
466
469
|
setStaged(files);
|
|
467
470
|
setRenames(/* @__PURE__ */ new Map());
|
|
468
|
-
} else
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
}, [allowRename, doUpload]);
|
|
471
|
+
} else await doUpload(files);
|
|
472
|
+
}, [allowRename, showImageOptions, showVideoOptions, doUpload]);
|
|
472
473
|
async function handleConfirmUpload() {
|
|
473
474
|
if (!staged) return;
|
|
474
475
|
const filesToUpload = staged.map((f, i) => {
|
|
@@ -498,21 +499,22 @@ function FileUploader({
|
|
|
498
499
|
onFiles: handleFiles,
|
|
499
500
|
style: { padding: "28px 24px", textAlign: "center" },
|
|
500
501
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "8px" }, children: [
|
|
501
|
-
renderIcon ? renderIcon() : /* @__PURE__ */ jsx("svg", { width: "40", height: "40", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", style: { color: "var(--silo-text-muted)", opacity: 0.
|
|
502
|
+
renderIcon ? renderIcon() : /* @__PURE__ */ jsx("svg", { width: "40", height: "40", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", style: { color: "var(--silo-text-muted)", opacity: 0.5 }, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5" }) }),
|
|
502
503
|
children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
503
|
-
/* @__PURE__ */ jsx("span", { style: { fontWeight:
|
|
504
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize:
|
|
505
|
-
maxSize && /* @__PURE__ */ jsxs("span", { style: { fontSize:
|
|
506
|
-
"
|
|
504
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 700, fontSize: 15, color: "var(--silo-text)" }, children: multiple ? "Arraste seus arquivos aqui" : "Arraste seu arquivo aqui" }),
|
|
505
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 13, color: "var(--silo-text-muted)" }, children: "ou clique para escolher do seu dispositivo" }),
|
|
506
|
+
maxSize && /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: "var(--silo-text-muted)" }, children: [
|
|
507
|
+
"Tamanho m\xE1ximo: ",
|
|
507
508
|
formatBytes(maxSize)
|
|
508
509
|
] })
|
|
509
510
|
] })
|
|
510
511
|
] })
|
|
511
512
|
}
|
|
512
513
|
),
|
|
513
|
-
staged && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap:
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
staged && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
515
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 13, fontWeight: 600, color: "var(--silo-text-muted)", marginBottom: 2 }, children: staged.length === 1 ? "1 arquivo selecionado" : `${staged.length} arquivos selecionados` }),
|
|
516
|
+
staged.map((f, i) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, padding: "10px 12px", backgroundColor: "var(--silo-bg)", borderRadius: 10, border: "1px solid var(--silo-border)" }, children: [
|
|
517
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 20, flexShrink: 0 }, children: getFileIcon(f.type) }),
|
|
516
518
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
517
519
|
editingIndex === i ? /* @__PURE__ */ jsx(
|
|
518
520
|
"input",
|
|
@@ -531,28 +533,28 @@ function FileUploader({
|
|
|
531
533
|
}
|
|
532
534
|
if (e.key === "Escape") setEditingIndex(null);
|
|
533
535
|
},
|
|
534
|
-
style: { width: "100%", fontSize:
|
|
536
|
+
style: { width: "100%", fontSize: 13, fontWeight: 500, border: "1px solid var(--silo-accent, #6366f1)", borderRadius: 5, padding: "2px 8px", outline: "none", background: "var(--silo-bg)", color: "var(--silo-text)", fontFamily: "var(--silo-font)" }
|
|
535
537
|
}
|
|
536
538
|
) : /* @__PURE__ */ jsxs(
|
|
537
539
|
"div",
|
|
538
540
|
{
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
541
|
+
style: { fontSize: 13, fontWeight: 600, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: "var(--silo-text)", cursor: allowRename ? "text" : "default" },
|
|
542
|
+
onClick: () => allowRename && setEditingIndex(i),
|
|
543
|
+
title: allowRename ? "Clique para renomear" : void 0,
|
|
542
544
|
children: [
|
|
543
545
|
effectiveName(i, staged),
|
|
544
546
|
renames.has(i) && /* @__PURE__ */ jsx("span", { style: { marginLeft: 6, fontSize: 10, color: "var(--silo-accent)", fontWeight: 700 }, children: "renomeado" })
|
|
545
547
|
]
|
|
546
548
|
}
|
|
547
549
|
),
|
|
548
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize:
|
|
550
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: "var(--silo-text-muted)", marginTop: 1 }, children: formatBytes(f.size) })
|
|
549
551
|
] }),
|
|
550
|
-
/* @__PURE__ */ jsx(
|
|
552
|
+
allowRename && /* @__PURE__ */ jsx(
|
|
551
553
|
"button",
|
|
552
554
|
{
|
|
553
555
|
onClick: () => setEditingIndex(i),
|
|
554
556
|
title: "Renomear",
|
|
555
|
-
style: { background: "none", border: "none", cursor: "pointer", fontSize:
|
|
557
|
+
style: { background: "none", border: "none", cursor: "pointer", fontSize: 14, color: "var(--silo-text-muted)", padding: "0 4px", flexShrink: 0 },
|
|
556
558
|
children: "\u270F\uFE0F"
|
|
557
559
|
}
|
|
558
560
|
),
|
|
@@ -561,39 +563,28 @@ function FileUploader({
|
|
|
561
563
|
{
|
|
562
564
|
onClick: () => {
|
|
563
565
|
const next = staged.filter((_, j) => j !== i);
|
|
564
|
-
if (next.length === 0)
|
|
565
|
-
|
|
566
|
-
} else {
|
|
567
|
-
setStaged(next);
|
|
568
|
-
}
|
|
566
|
+
if (next.length === 0) clearStaging();
|
|
567
|
+
else setStaged(next);
|
|
569
568
|
},
|
|
570
|
-
style: { background: "none", border: "none", cursor: "pointer", fontSize:
|
|
569
|
+
style: { background: "none", border: "none", cursor: "pointer", fontSize: 18, color: "var(--silo-text-muted)", padding: "0 4px", lineHeight: 1, flexShrink: 0 },
|
|
571
570
|
children: "\xD7"
|
|
572
571
|
}
|
|
573
572
|
)
|
|
574
573
|
] }, i)),
|
|
575
|
-
showImageOptions && staged.some((f) => f.type.startsWith("image/")) && /* @__PURE__ */
|
|
576
|
-
|
|
577
|
-
{
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
),
|
|
583
|
-
|
|
584
|
-
VideoOptions,
|
|
585
|
-
{
|
|
586
|
-
value: videoOpts,
|
|
587
|
-
onChange: setVideoOpts,
|
|
588
|
-
style: { padding: "12px 14px", borderRadius: 8, border: "1px solid var(--silo-border)", background: "var(--silo-bg-hover, #f8fafc)", marginTop: 4 }
|
|
589
|
-
}
|
|
590
|
-
),
|
|
591
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", marginTop: "4px" }, children: [
|
|
574
|
+
showImageOptions && staged.some((f) => f.type.startsWith("image/")) && /* @__PURE__ */ jsxs("div", { style: { borderRadius: 10, border: "1px solid var(--silo-border)", overflow: "hidden" }, children: [
|
|
575
|
+
/* @__PURE__ */ jsx("div", { style: { padding: "8px 14px", background: "var(--silo-bg-hover, #f1f5f9)", fontSize: 12, fontWeight: 700, color: "var(--silo-text-muted)", letterSpacing: "0.04em" }, children: "\u{1F5BC}\uFE0F Configura\xE7\xF5es de imagem" }),
|
|
576
|
+
/* @__PURE__ */ jsx(ImageOptions, { value: imageOpts, onChange: setImageOpts, style: { padding: "12px 14px" } })
|
|
577
|
+
] }),
|
|
578
|
+
showVideoOptions && staged.some((f) => f.type.startsWith("video/")) && /* @__PURE__ */ jsxs("div", { style: { borderRadius: 10, border: "1px solid var(--silo-border)", overflow: "hidden" }, children: [
|
|
579
|
+
/* @__PURE__ */ jsx("div", { style: { padding: "8px 14px", background: "var(--silo-bg-hover, #f1f5f9)", fontSize: 12, fontWeight: 700, color: "var(--silo-text-muted)", letterSpacing: "0.04em" }, children: "\u{1F3AC} Configura\xE7\xF5es de v\xEDdeo" }),
|
|
580
|
+
/* @__PURE__ */ jsx(VideoOptions, { value: videoOpts, onChange: setVideoOpts, style: { padding: "12px 14px" } })
|
|
581
|
+
] }),
|
|
582
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, marginTop: 4 }, children: [
|
|
592
583
|
/* @__PURE__ */ jsx(
|
|
593
584
|
"button",
|
|
594
585
|
{
|
|
595
586
|
onClick: clearStaging,
|
|
596
|
-
style: { padding: "
|
|
587
|
+
style: { padding: "10px 16px", borderRadius: 8, border: "1px solid var(--silo-border)", background: "transparent", color: "var(--silo-text-muted)", fontSize: 13, fontWeight: 600, cursor: "pointer" },
|
|
597
588
|
children: "Cancelar"
|
|
598
589
|
}
|
|
599
590
|
),
|
|
@@ -601,72 +592,82 @@ function FileUploader({
|
|
|
601
592
|
"button",
|
|
602
593
|
{
|
|
603
594
|
onClick: handleConfirmUpload,
|
|
604
|
-
style: { flex: 1, padding: "
|
|
595
|
+
style: { flex: 1, padding: "10px", borderRadius: 8, border: "none", background: "var(--silo-accent, #6366f1)", color: "#fff", fontSize: 14, fontWeight: 700, cursor: "pointer" },
|
|
605
596
|
children: staged.length > 1 ? `Enviar ${staged.length} arquivos` : "Enviar arquivo"
|
|
606
597
|
}
|
|
607
598
|
)
|
|
608
599
|
] })
|
|
609
600
|
] }),
|
|
610
|
-
isSingleUploading && !isBatch && /* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between",
|
|
612
|
-
/* @__PURE__ */ jsx("span", {
|
|
613
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
601
|
+
isSingleUploading && !isBatch && (renderProgress ? renderProgress(singleProgress) : /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8, padding: "16px", borderRadius: 10, border: "1px solid var(--silo-border)", background: "var(--silo-bg)" }, children: [
|
|
602
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
603
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 13, fontWeight: 600, color: "var(--silo-text)" }, children: uploadLabel(single.state.status, singleProgress) }),
|
|
604
|
+
/* @__PURE__ */ jsxs("span", { style: { fontSize: 13, fontWeight: 700, color: "var(--silo-accent, #6366f1)" }, children: [
|
|
614
605
|
singleProgress,
|
|
615
606
|
"%"
|
|
616
607
|
] })
|
|
617
608
|
] }),
|
|
618
609
|
/* @__PURE__ */ jsx(ProgressBar, { progress: singleProgress })
|
|
619
|
-
] })
|
|
620
|
-
isBatch && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap:
|
|
610
|
+
] })),
|
|
611
|
+
isBatch && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
621
612
|
batch.state.files.map((f, i) => {
|
|
622
613
|
const st = f.status;
|
|
623
614
|
const p = st.status === "uploading" ? st.progress : st.status === "paused" ? st.progress : st.status === "done" ? 100 : st.status === "completing" ? 99 : 0;
|
|
624
615
|
const isPaused = st.status === "paused";
|
|
625
616
|
const isDone = st.status === "done";
|
|
626
617
|
const isErr = st.status === "error";
|
|
627
|
-
return /* @__PURE__ */ jsxs("div", { style: { padding: "
|
|
628
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap:
|
|
629
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize:
|
|
618
|
+
return /* @__PURE__ */ jsxs("div", { style: { padding: "12px 14px", backgroundColor: "var(--silo-bg)", borderRadius: 10, border: "1px solid var(--silo-border)" }, children: [
|
|
619
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, marginBottom: isDone || isErr ? 0 : 8 }, children: [
|
|
620
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 18, flexShrink: 0 }, children: getFileIcon(f.file.type) }),
|
|
630
621
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
631
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize:
|
|
632
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize:
|
|
622
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 13, fontWeight: 600, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: "var(--silo-text)" }, children: f.file.name }),
|
|
623
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: "var(--silo-text-muted)" }, children: formatBytes(f.file.size) })
|
|
633
624
|
] }),
|
|
634
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize:
|
|
635
|
-
|
|
625
|
+
isDone && /* @__PURE__ */ jsx("span", { style: { fontSize: 18, flexShrink: 0 }, children: "\u2705" }),
|
|
626
|
+
isErr && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#ef4444", fontWeight: 600, flexShrink: 0 }, children: "Erro no envio" }),
|
|
627
|
+
!isDone && !isErr && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, fontWeight: 700, color: isPaused ? "#f59e0b" : "var(--silo-accent, #6366f1)", flexShrink: 0 }, children: isPaused ? "Pausado" : `${p}%` }),
|
|
628
|
+
!isDone && !isErr && f.fileId && (isPaused ? /* @__PURE__ */ jsx("button", { onClick: () => batch.resumeFile(f.fileId), style: { fontSize: 11, padding: "3px 10px", borderRadius: 6, border: "none", background: "#10b981", color: "#fff", cursor: "pointer", fontWeight: 600 }, children: "Retomar" }) : st.status === "uploading" ? /* @__PURE__ */ jsx("button", { onClick: () => batch.pauseFile(f.fileId), style: { fontSize: 11, padding: "3px 10px", borderRadius: 6, border: "1px solid var(--silo-border)", background: "transparent", color: "var(--silo-text-muted)", cursor: "pointer" }, children: "Pausar" }) : null)
|
|
636
629
|
] }),
|
|
637
630
|
!isDone && !isErr && /* @__PURE__ */ jsx(ProgressBar, { progress: p })
|
|
638
631
|
] }, i);
|
|
639
632
|
}),
|
|
640
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap:
|
|
633
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
641
634
|
batch.state.status !== "done" && /* @__PURE__ */ jsx(
|
|
642
635
|
"button",
|
|
643
636
|
{
|
|
644
637
|
onClick: isBatchUploading ? batch.pauseAll : batch.resumeAll,
|
|
645
|
-
style: { flex: 1, padding: "
|
|
646
|
-
children: isBatchUploading ? "Pausar tudo" : "Retomar tudo"
|
|
638
|
+
style: { flex: 1, padding: "10px", borderRadius: 8, border: "none", background: isBatchUploading ? "#f59e0b" : "#10b981", color: "#fff", fontSize: 13, fontWeight: 700, cursor: "pointer" },
|
|
639
|
+
children: isBatchUploading ? "\u23F8 Pausar tudo" : "\u25B6 Retomar tudo"
|
|
647
640
|
}
|
|
648
641
|
),
|
|
649
642
|
/* @__PURE__ */ jsx(
|
|
650
643
|
"button",
|
|
651
644
|
{
|
|
652
645
|
onClick: batch.state.status === "done" ? batch.reset : batch.abortAll,
|
|
653
|
-
style: { padding: "
|
|
654
|
-
children: batch.state.status === "done" ? "
|
|
646
|
+
style: { padding: "10px 16px", borderRadius: 8, border: "none", background: batch.state.status === "done" ? "var(--silo-accent, #6366f1)" : "rgba(239,68,68,0.1)", color: batch.state.status === "done" ? "#fff" : "#ef4444", fontSize: 13, fontWeight: 700, cursor: "pointer" },
|
|
647
|
+
children: batch.state.status === "done" ? "Enviar mais arquivos" : "Cancelar"
|
|
655
648
|
}
|
|
656
649
|
)
|
|
650
|
+
] }),
|
|
651
|
+
batch.state.status === "done" && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, padding: "12px 14px", borderRadius: 10, background: "rgba(34,197,94,0.08)", border: "1px solid rgba(34,197,94,0.2)" }, children: [
|
|
652
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 20 }, children: "\u{1F389}" }),
|
|
653
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 14, fontWeight: 600, color: "#16a34a" }, children: batch.state.files.length === 1 ? "Arquivo enviado com sucesso!" : `${batch.state.files.length} arquivos enviados com sucesso!` })
|
|
657
654
|
] })
|
|
658
655
|
] }),
|
|
659
|
-
single.state.status === "done" && !renderSuccess && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap:
|
|
660
|
-
/* @__PURE__ */ jsx("
|
|
656
|
+
single.state.status === "done" && !renderSuccess && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "14px 16px", borderRadius: 10, background: "rgba(34,197,94,0.08)", border: "1px solid rgba(34,197,94,0.2)" }, children: [
|
|
657
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 24 }, children: "\u2705" }),
|
|
661
658
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
662
|
-
/* @__PURE__ */ jsx("div", { style: { fontWeight:
|
|
663
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize:
|
|
659
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 14, color: "#16a34a" }, children: "Arquivo enviado com sucesso!" }),
|
|
660
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: "var(--silo-text-muted)", marginTop: 2 }, children: formatBytes(single.state.result.size) })
|
|
664
661
|
] }),
|
|
665
|
-
/* @__PURE__ */ jsx("button", { onClick: single.reset, style: { background: "none", border: "
|
|
662
|
+
/* @__PURE__ */ jsx("button", { onClick: single.reset, style: { background: "none", border: "1px solid rgba(34,197,94,0.3)", borderRadius: 6, cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#16a34a", padding: "4px 10px", flexShrink: 0 }, children: "Enviar outro" })
|
|
666
663
|
] }),
|
|
667
|
-
single.state.status === "error" && !renderError && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap:
|
|
668
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
669
|
-
/* @__PURE__ */
|
|
664
|
+
single.state.status === "error" && !renderError && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "14px 16px", borderRadius: 10, background: "rgba(239,68,68,0.07)", border: "1px solid rgba(239,68,68,0.2)" }, children: [
|
|
665
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 22 }, children: "\u26A0\uFE0F" }),
|
|
666
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
667
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 13, color: "#ef4444" }, children: "N\xE3o foi poss\xEDvel enviar o arquivo" }),
|
|
668
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: "var(--silo-text-muted)", marginTop: 2 }, children: single.state.error.message })
|
|
669
|
+
] }),
|
|
670
|
+
/* @__PURE__ */ jsx("button", { onClick: single.reset, style: { background: "none", border: "1px solid rgba(239,68,68,0.3)", borderRadius: 6, cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#ef4444", padding: "4px 10px", flexShrink: 0 }, children: "Tentar novamente" })
|
|
670
671
|
] })
|
|
671
672
|
] });
|
|
672
673
|
}
|