From 8547034e6d82e4d1184f35af2dbff67180d89dc8 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Wed, 26 Nov 2025 18:09:18 +0900
Subject: (김준회) dolce: 동기화 기능 추가, 로컬 다운로드, 삭제 추가, 동기화
 dialog 개선 등
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/dolce/table/file-list-columns.tsx | 45 ++++++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 11 deletions(-)

(limited to 'lib/dolce/table/file-list-columns.tsx')

diff --git a/lib/dolce/table/file-list-columns.tsx b/lib/dolce/table/file-list-columns.tsx
index 36a579a3..38b1f1c9 100644
--- a/lib/dolce/table/file-list-columns.tsx
+++ b/lib/dolce/table/file-list-columns.tsx
@@ -3,16 +3,18 @@
 import { ColumnDef } from "@tanstack/react-table";
 import { FileInfoItem } from "../actions";
 import { Button } from "@/components/ui/button";
-import { Download } from "lucide-react";
+import { Download, Trash2 } from "lucide-react";
 import { formatDolceDateTime } from "../utils/date-formatter";
 
 interface FileListColumnsProps {
   onDownload: (file: FileInfoItem) => void;
+  onDelete?: (file: FileInfoItem) => void;
   lng?: string;
 }
 
 export const createFileListColumns = ({
   onDownload,
+  onDelete,
   lng = "ko",
 }: FileListColumnsProps): ColumnDef<FileInfoItem>[] => [
   {
@@ -20,6 +22,9 @@ export const createFileListColumns = ({
     header: lng === "ko" ? "순번" : "No.",
     minSize: 80,
     cell: ({ row }) => {
+      if (row.original.FileServerId === "LOCAL") {
+        return <div className="text-center">-</div>;
+      }
       return <div className="text-center">{row.getValue("FileSeq")}</div>;
     },
   },
@@ -55,18 +60,36 @@ export const createFileListColumns = ({
   },
   {
     id: "actions",
-    header: lng === "ko" ? "다운로드" : "Download",
-    minSize: 120,
+    header: "Action",
+    minSize: 160,
     cell: ({ row }) => {
+      const isLocal = row.original.FileServerId === "LOCAL";
       return (
-        <Button
-          variant="outline"
-          size="sm"
-          onClick={() => onDownload(row.original)}
-        >
-          <Download className="h-4 w-4 mr-2" />
-          {lng === "ko" ? "다운로드" : "Download"}
-        </Button>
+        <div className="flex gap-2 items-center justify-center">
+            <Button
+            variant="outline"
+            size="sm"
+            onClick={(e) => {
+                e.stopPropagation();
+                onDownload(row.original);
+            }}
+            >
+            <Download className="h-4 w-4 mr-2" />
+            {lng === "ko" ? "다운로드" : "Download"}
+            </Button>
+            {isLocal && onDelete && (
+                <Button
+                    variant="destructive"
+                    size="sm"
+                    onClick={(e) => {
+                        e.stopPropagation();
+                        onDelete(row.original);
+                    }}
+                >
+                    <Trash2 className="h-4 w-4" />
+                </Button>
+            )}
+        </div>
       );
     },
   },
-- 
cgit v1.2.3

