"use client"; import { ColumnDef } from "@tanstack/react-table"; import { Badge } from "@/components/ui/badge"; import type { DocumentListItem } from "@/lib/swp/document-service"; export const swpDocumentColumns: ColumnDef[] = [ { accessorKey: "LTST_ACTV_STAT", header: "상태", cell: ({ row }) => { const status = row.original.LTST_ACTV_STAT; if (!status) return "-"; const color = status.includes("Complete") ? "bg-green-100 text-green-800" : status.includes("Progress") ? "bg-blue-100 text-blue-800" : status.includes("Pending") || status.includes("Ready") ? "bg-yellow-100 text-yellow-800" : "bg-gray-100 text-gray-800"; return ( {status} ); }, size: 120, }, { accessorKey: "DOC_NO", header: "문서번호", cell: ({ row }) => (
{row.original.DOC_NO}
), size: 250, }, { accessorKey: "DOC_TITLE", header: "문서제목", cell: ({ row }) => (
{row.original.DOC_TITLE}
), size: 300, }, { accessorKey: "PROJ_NO", header: "프로젝트", cell: ({ row }) => (
{row.original.PROJ_NO}
{row.original.PROJ_NM && (
{row.original.PROJ_NM}
)}
), size: 150, }, { accessorKey: "PKG_NO", header: "패키지", cell: ({ row }) => row.original.PKG_NO || "-", size: 100, }, { accessorKey: "VNDR_CD", header: "업체", cell: ({ row }) => (
{row.original.VNDR_CD && (
{row.original.VNDR_CD}
)} {row.original.CPY_NM && (
{row.original.CPY_NM}
)}
), size: 120, }, { accessorKey: "STAGE", header: "스테이지", cell: ({ row }) => { const stage = row.original.STAGE; if (!stage) return "-"; const color = stage === "IFC" ? "bg-green-100 text-green-800" : stage === "IFA" ? "bg-blue-100 text-blue-800" : "bg-gray-100 text-gray-800"; return ( {stage} ); }, size: 80, }, { accessorKey: "LTST_REV_NO", header: "최신 REV", cell: ({ row }) => row.original.LTST_REV_NO || "-", size: 80, }, { id: "stats", header: "파일", cell: ({ row }) => (
{row.original.fileCount}개
{row.original.standbyFileCount > 0 && (
대기중 {row.original.standbyFileCount}
)}
), size: 100, }, ];