summaryrefslogtreecommitdiff
path: root/lib/dolce/table
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-26 18:57:47 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-26 18:57:47 +0900
commit2b5d063ab408a163c016358251192a07a337eaa7 (patch)
tree71b9678169666211dc07663a1b1b9c8c0acf8b91 /lib/dolce/table
parent5a370de52d6947d35aa07f9545c4f6a4d83eadd7 (diff)
(김준회) dolce: 다운로드 시각적 피드백 표시 (UX)
Diffstat (limited to 'lib/dolce/table')
-rw-r--r--lib/dolce/table/file-list-columns.tsx14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/dolce/table/file-list-columns.tsx b/lib/dolce/table/file-list-columns.tsx
index 38b1f1c9..3018e240 100644
--- a/lib/dolce/table/file-list-columns.tsx
+++ b/lib/dolce/table/file-list-columns.tsx
@@ -3,19 +3,21 @@
import { ColumnDef } from "@tanstack/react-table";
import { FileInfoItem } from "../actions";
import { Button } from "@/components/ui/button";
-import { Download, Trash2 } from "lucide-react";
+import { Download, Trash2, Loader2 } from "lucide-react";
import { formatDolceDateTime } from "../utils/date-formatter";
interface FileListColumnsProps {
onDownload: (file: FileInfoItem) => void;
onDelete?: (file: FileInfoItem) => void;
lng?: string;
+ downloadingFileId?: string | null;
}
export const createFileListColumns = ({
onDownload,
onDelete,
lng = "ko",
+ downloadingFileId,
}: FileListColumnsProps): ColumnDef<FileInfoItem>[] => [
{
accessorKey: "FileSeq",
@@ -64,23 +66,31 @@ export const createFileListColumns = ({
minSize: 160,
cell: ({ row }) => {
const isLocal = row.original.FileServerId === "LOCAL";
+ const isDownloading = downloadingFileId === row.original.FileId;
+
return (
<div className="flex gap-2 items-center justify-center">
<Button
variant="outline"
size="sm"
+ disabled={isDownloading}
onClick={(e) => {
e.stopPropagation();
onDownload(row.original);
}}
>
- <Download className="h-4 w-4 mr-2" />
+ {isDownloading ? (
+ <Loader2 className="h-4 w-4 mr-2 animate-spin" />
+ ) : (
+ <Download className="h-4 w-4 mr-2" />
+ )}
{lng === "ko" ? "다운로드" : "Download"}
</Button>
{isLocal && onDelete && (
<Button
variant="destructive"
size="sm"
+ disabled={isDownloading}
onClick={(e) => {
e.stopPropagation();
onDelete(row.original);