diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-03 17:28:06 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-03 17:28:06 +0900 |
| commit | a9c038e51f1cf508165e9d196ffe332f6ac54d74 (patch) | |
| tree | 406d7083621902eeaff4cce6c1c306445f57e4e9 /lib/swp/table/swp-table-columns.tsx | |
| parent | df5a6201bdf8ff9edfc6429b918cf2fd2b245684 (diff) | |
(김준회) SWP: 커버페이지 다운로드 버튼 추가 (문서별)
Diffstat (limited to 'lib/swp/table/swp-table-columns.tsx')
| -rw-r--r-- | lib/swp/table/swp-table-columns.tsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/swp/table/swp-table-columns.tsx b/lib/swp/table/swp-table-columns.tsx index 48b2c90a..5334bd8c 100644 --- a/lib/swp/table/swp-table-columns.tsx +++ b/lib/swp/table/swp-table-columns.tsx @@ -2,6 +2,8 @@ import { ColumnDef } from "@tanstack/react-table"; import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Download } from "lucide-react"; import type { DocumentListItem } from "@/lib/swp/document-service"; export const swpDocumentColumns: ColumnDef<DocumentListItem>[] = [ @@ -125,4 +127,27 @@ export const swpDocumentColumns: ColumnDef<DocumentListItem>[] = [ ), size: 100, }, + { + id: "actions", + header: "액션", + cell: ({ row }) => ( + <Button + variant="ghost" + size="sm" + onClick={(e) => { + e.stopPropagation(); // 행 클릭 이벤트 방지 + // 커버페이지 다운로드 핸들러는 부모 컴포넌트에서 제공 + const event = new CustomEvent('coverDownload', { + detail: { document: row.original } + }); + window.dispatchEvent(event); + }} + className="h-8 px-2" + > + <Download className="h-4 w-4 mr-1" /> + 커버페이지 + </Button> + ), + size: 120, + }, ]; |
