Files
frontend/apps/cs/src/pages/menu/model/board-table-columns.tsx
T

46 lines
1.0 KiB
TypeScript

import type { ColumnDef } from "@tanstack/react-table";
import { Checkbox } from "@common/components";
import type { BoardPopup } from "@/entities/board";
export const columns: ColumnDef<BoardPopup>[] = [
{
id: "no",
header: "NO",
cell: ({ row, table }) => {
const totalRows = table.getRowCount();
const currentPage = table.getState().pagination.pageIndex;
const pageSize = table.getState().pagination.pageSize;
return totalRows - (currentPage * pageSize + row.index);
},
},
{
accessorKey: "bbsNm",
header: "게시판명",
},
{
accessorKey: "bbsTypeNm",
header: "게시판유형",
},
{
accessorKey: "regDt",
header: "최초생성일",
},
{
accessorKey: "pstCnt",
header: "게시물건수",
},
{
id: "select",
header: "선택",
cell: ({ row }) => {
return (
<Checkbox
checked={row.getIsSelected()}
onCheckedChange={row.getToggleSelectedHandler()}
className="mx-4 flex justify-center"
/>
);
},
},
];