import dayjs from "dayjs"; import type { ColumnDef } from "@tanstack/react-table"; import type { MyPost, NoticePost } from "@/entities/post"; import type { Schedule } from "../api/schedule-service"; const noticePostTableColumns: ColumnDef[] = [ { accessorKey: "pstTtl", header: "제목", }, { accessorKey: "wrtrNm", header: "작성자", }, { accessorKey: "regDt", header: "작성일", cell: ({ row }) => dayjs(row.original.regDt).format("YYYY-MM-DD"), }, { accessorKey: "inqNocs", header: "조회수", }, ]; const myPostTableColumns: ColumnDef[] = [ { accessorKey: "pstTtl", header: "제목", }, { accessorKey: "regDt", header: "작성일", cell: ({ row }) => dayjs(row.original.regDt).format("YYYY-MM-DD"), }, ]; const scheduleTableColumns: ColumnDef[] = [ { accessorKey: "schdlTtl", header: "주요일정", cell: ({ row }) => { const startDate = dayjs(row.original.schdlBgngDt).format("YYYY-MM-DD"); const endDate = dayjs(row.original.schdlEndDt).format("YYYY-MM-DD"); const schdlTtl = row.original.schdlTtl; return (
[{startDate} ~ {endDate}]
{schdlTtl}
); }, }, ]; export { noticePostTableColumns, myPostTableColumns, scheduleTableColumns };