"use client"; import dayjs from "dayjs"; import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "@common/components"; import type { Post } from "@/entities/posting"; export const columns: ColumnDef[] = [ { id: "select", header: ({ table }) => ( e.stopPropagation()} onCheckedChange={(checked) => table.toggleAllPageRowsSelected(!!checked) } className="h-4 w-4 rounded border-gray-300" /> ), cell: ({ row }) => ( e.stopPropagation()} onCheckedChange={(checked) => row.toggleSelected(!!checked)} className="h-4 w-4 rounded border-gray-300" /> ), }, { accessorKey: "siteNm", header: "사이트", }, { accessorKey: "pstgPrdSeNm", header: "게시기간", cell: ({ row }) => { const pstgPrdSeCd = row.original.pstgPrdSeCd; const pstgPrdSeNm = row.original.pstgPrdSeNm; const pstgBgngDt = row.original.pstgBgngDt; const pstgEndDt = row.original.pstgEndDt; if (pstgPrdSeCd === "99") { return pstgPrdSeNm; } return `${pstgPrdSeNm} (${dayjs(pstgBgngDt).format("YYYY-MM-DD")} ~ ${dayjs(pstgEndDt).format("YYYY-MM-DD")})`; }, }, ];