From dec7dedd9409f1ee1afa2ac1ca7c17ff611c3df8 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Tue, 2 Sep 2025 08:50:02 +0000
Subject: (김준회) MDG 프로젝트 마스터 수신시 전체 데이터 projects 비지니스
 테이블에 매핑처리 - 테이블 컬럼 확장 - projects 페이지 프론트엔드 처리 - mdg
 수신 route에서 mapper 확장
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/projects/table/projects-table-columns.tsx | 29 +++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

(limited to 'lib/projects/table/projects-table-columns.tsx')

diff --git a/lib/projects/table/projects-table-columns.tsx b/lib/projects/table/projects-table-columns.tsx
index 6926429a..95eeae85 100644
--- a/lib/projects/table/projects-table-columns.tsx
+++ b/lib/projects/table/projects-table-columns.tsx
@@ -3,8 +3,10 @@
 import * as React from "react"
 import { type DataTableRowAction } from "@/types/table"
 import { type ColumnDef } from "@tanstack/react-table"
+import { Eye } from "lucide-react"
 
 import { formatDate } from "@/lib/utils"
+import { Button } from "@/components/ui/button"
 
 import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header"
 import { Project } from "@/db/schema"
@@ -12,13 +14,35 @@ import { projectsColumnsConfig } from "@/config/projectsColumnsConfig"
 
 interface GetColumnsProps {
   setRowAction: React.Dispatch<React.SetStateAction<DataTableRowAction<Project> | null>>
+  onDetailClick: (project: Project) => void
 }
 
 /**
  * tanstack table 컬럼 정의 (중첩 헤더 버전)
  */
-export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef<Project>[] {
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+export function getColumns({ setRowAction, onDetailClick }: GetColumnsProps): ColumnDef<Project>[] {
+  // 상세보기 버튼 컬럼
+  const detailColumn: ColumnDef<Project> = {
+    id: "action",
+    header: "상세보기",
+    size: 100,
+    cell: ({ row }) => {
+      const project = row.original
 
+      return (
+        <Button
+          variant="ghost"
+          size="sm"
+          onClick={() => onDetailClick(project)}
+          className="h-8 w-8 p-0"
+        >
+          <Eye className="h-4 w-4" />
+          <span className="sr-only">상세보기</span>
+        </Button>
+      )
+    },
+  }
 
   // ----------------------------------------------------------------
   // 3) 일반 컬럼들을 "그룹"별로 묶어 중첩 columns 생성
@@ -82,9 +106,10 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef<Project
   })
 
   // ----------------------------------------------------------------
-  // 4) 최종 컬럼 배열: select, nestedColumns, actions
+  // 4) 최종 컬럼 배열: detailColumn, nestedColumns
   // ----------------------------------------------------------------
   return [
+    detailColumn,
     ...nestedColumns,
   ]
 }
\ No newline at end of file
-- 
cgit v1.2.3

