diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-11-03 10:15:45 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-11-03 10:15:45 +0000 |
| commit | f2fafe555b65f9207c2c6e216b7d7b2ff83af866 (patch) | |
| tree | 4a230e4bde10a612150a299922bc04cb15b0930f /lib/approval-template/table/approval-template-table-toolbar-actions.tsx | |
| parent | 1e857a0b1443ad2124caf3d180b7195651fe33e4 (diff) | |
(최겸) 구매 PQ/실사 수정
Diffstat (limited to 'lib/approval-template/table/approval-template-table-toolbar-actions.tsx')
| -rw-r--r-- | lib/approval-template/table/approval-template-table-toolbar-actions.tsx | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/approval-template/table/approval-template-table-toolbar-actions.tsx b/lib/approval-template/table/approval-template-table-toolbar-actions.tsx index 62754cc1..4fa4b394 100644 --- a/lib/approval-template/table/approval-template-table-toolbar-actions.tsx +++ b/lib/approval-template/table/approval-template-table-toolbar-actions.tsx @@ -25,53 +25,6 @@ export function ApprovalTemplateTableToolbarActions({ const selectedRows = table.getFilteredSelectedRowModel().rows const selectedTemplates = selectedRows.map((row) => row.original) - // CSV 내보내기 - const exportToCsv = React.useCallback(() => { - const headers = [ - "이름", - "제목", - "카테고리", - "생성일", - "수정일", - ] - - const csvData = [ - headers, - ...table.getFilteredRowModel().rows.map((row) => { - const t = row.original - return [ - t.name, - t.subject, - t.category ?? "-", - new Date(t.createdAt).toLocaleDateString("ko-KR"), - new Date(t.updatedAt).toLocaleDateString("ko-KR"), - ] - }), - ] - - const csvContent = csvData - .map((row) => row.map((field) => `"${field}"`).join(",")) - .join("\n") - - const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" }) - const link = document.createElement("a") - - if (link.download !== undefined) { - const url = URL.createObjectURL(blob) - link.setAttribute("href", url) - link.setAttribute( - "download", - `approval_templates_${new Date().toISOString().split("T")[0]}.csv`, - ) - link.style.visibility = "hidden" - document.body.appendChild(link) - link.click() - document.body.removeChild(link) - } - - toast.success("템플릿 목록이 CSV로 내보내졌습니다.") - }, [table]) - return ( <div className="flex items-center gap-2"> {/* 카테고리 관리 버튼 */} @@ -92,12 +45,6 @@ export function ApprovalTemplateTableToolbarActions({ 새 템플릿 </Button> - {/* CSV 내보내기 */} - <Button variant="outline" size="sm" onClick={exportToCsv}> - <Download className="mr-2 size-4" aria-hidden="true" /> - 내보내기 - </Button> - {/* 일괄 삭제 */} {selectedTemplates.length > 0 && ( <> |
