49 lines
1.0 KiB
TypeScript
49 lines
1.0 KiB
TypeScript
import dayjs from "dayjs";
|
|
import { type ColumnDef } from "@tanstack/react-table";
|
|
import type { Site } from "@/entities/site";
|
|
|
|
export const columns: ColumnDef<Site>[] = [
|
|
{
|
|
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: "siteId",
|
|
header: "사이트코드",
|
|
},
|
|
{
|
|
accessorKey: "siteNm",
|
|
header: "사이트명",
|
|
},
|
|
{
|
|
accessorKey: "dmnAddr",
|
|
header: "대표 URL",
|
|
},
|
|
{
|
|
accessorKey: "bscSiteYn",
|
|
header: "기본 사이트 여부",
|
|
},
|
|
{
|
|
accessorKey: "useYn",
|
|
header: "사용 여부",
|
|
},
|
|
{
|
|
accessorKey: "rgTrNm",
|
|
header: "등록자",
|
|
},
|
|
{
|
|
accessorKey: "regDt",
|
|
header: "등록일",
|
|
cell: ({ row }) => {
|
|
const date = dayjs(row.original.regDt);
|
|
return date.format("YYYY-MM-DD");
|
|
},
|
|
},
|
|
];
|