From 26365ef08588d53b8c5d9c7cfaefb244536e6743 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 24 Nov 2025 10:41:46 +0900 Subject: (김준회) 돌체 재개발 - 2차: 업로드 개선, 다운로드 오류 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/dolce/components/file-upload-progress-list.tsx | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 lib/dolce/components/file-upload-progress-list.tsx (limited to 'lib/dolce/components/file-upload-progress-list.tsx') diff --git a/lib/dolce/components/file-upload-progress-list.tsx b/lib/dolce/components/file-upload-progress-list.tsx new file mode 100644 index 00000000..e016402d --- /dev/null +++ b/lib/dolce/components/file-upload-progress-list.tsx @@ -0,0 +1,98 @@ +"use client"; + +import { FileText, CheckCircle2, XCircle, Loader2 } from "lucide-react"; +import { Progress } from "@/components/ui/progress"; +import { FileUploadProgress } from "../hooks/use-file-upload-with-progress"; + +interface FileUploadProgressListProps { + fileProgresses: FileUploadProgress[]; +} + +export function FileUploadProgressList({ fileProgresses }: FileUploadProgressListProps) { + if (fileProgresses.length === 0) { + return null; + } + + return ( +
+

+ 파일 업로드 진행 상황 ({fileProgresses.length}개) +

+
+ {fileProgresses.map((fileProgress, index) => ( + + ))} +
+
+ ); +} + +interface FileUploadProgressItemProps { + fileProgress: FileUploadProgress; +} + +function FileUploadProgressItem({ fileProgress }: FileUploadProgressItemProps) { + const { file, progress, status, error } = fileProgress; + + const getStatusIcon = () => { + switch (status) { + case "completed": + return ; + case "error": + return ; + case "uploading": + return ; + default: + return ; + } + }; + + const getStatusColor = () => { + switch (status) { + case "completed": + return "border-green-200 bg-green-50/50"; + case "error": + return "border-red-200 bg-red-50/50"; + case "uploading": + return "border-primary/30 bg-primary/5"; + default: + return "border-muted bg-muted/30"; + } + }; + + return ( +
+
+ {getStatusIcon()} +
+

{file.name}

+

+ {(file.size / 1024 / 1024).toFixed(2)} MB +

+
+ {status !== "pending" && ( +
+ {status === "completed" ? ( + 완료 + ) : status === "error" ? ( + 실패 + ) : ( + {Math.round(progress)}% + )} +
+ )} +
+ + {/* Progress Bar */} + {status === "uploading" && ( + + )} + + {/* 에러 메시지 */} + {status === "error" && error && ( +

{error}

+ )} +
+ ); +} + -- cgit v1.2.3