From 90f79a7a691943a496f67f01c1e493256070e4de Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 7 Jul 2025 01:44:45 +0000 Subject: (대표님) 변경사항 20250707 10시 43분 - unstaged 변경사항 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/project-gtc-table-columns.tsx | 50 +++------------------- 1 file changed, 6 insertions(+), 44 deletions(-) (limited to 'lib/project-gtc/table/project-gtc-table-columns.tsx') diff --git a/lib/project-gtc/table/project-gtc-table-columns.tsx b/lib/project-gtc/table/project-gtc-table-columns.tsx index dfdf1921..141d5737 100644 --- a/lib/project-gtc/table/project-gtc-table-columns.tsx +++ b/lib/project-gtc/table/project-gtc-table-columns.tsx @@ -21,47 +21,12 @@ import { import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header" import { ProjectGtcView } from "@/db/schema" +import { FileActionsDropdown } from "@/components/ui/file-actions" interface GetColumnsProps { setRowAction: React.Dispatch | null>> } -/** - * 파일 다운로드 함수 - */ -const handleFileDownload = async (projectId: number, fileName: string) => { - try { - // API를 통해 파일 다운로드 - const response = await fetch(`/api/project-gtc?action=download&projectId=${projectId}`, { - method: 'GET', - }); - - if (!response.ok) { - throw new Error('파일 다운로드에 실패했습니다.'); - } - - // 파일 blob 생성 - const blob = await response.blob(); - - // 다운로드 링크 생성 - const url = window.URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = fileName; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - - // 메모리 정리 - window.URL.revokeObjectURL(url); - - toast.success("파일 다운로드를 시작합니다."); - } catch (error) { - console.error("파일 다운로드 오류:", error); - toast.error("파일 다운로드 중 오류가 발생했습니다."); - } -}; - /** * tanstack table 컬럼 정의 (중첩 헤더 버전) */ @@ -108,17 +73,14 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef handleFileDownload(project.id, project.originalFileName!)} - title={`${project.originalFileName} 다운로드`} - className="hover:bg-muted" - > - - 다운로드 - + /> ); }, maxSize: 30, -- cgit v1.2.3