import dayjs from "dayjs"; import { type ColumnDef } from "@tanstack/react-table"; import type { Authorizations } from "@/entities/authorization"; import { ManagementAuthorityDialog } from "../ui/management-authority-dialog"; export const columns: ColumnDef[] = [ { 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: "authorizationName", header: "API명", }, { accessorKey: "urlPatternValue", header: "API URL", }, { accessorKey: "httpMethodCode", header: "요청 메소드", }, { accessorKey: "useYn", header: "사용여부", }, { accessorKey: "mdfr", header: "최종수정자", }, { accessorKey: "mdfcnDt", header: "최종수정일", cell: ({ row }) => { const date = dayjs(row.original.mdfcnDt); return date.format("YYYY-MM-DD"); }, }, { id: "action", header: "권한관리", cell: ({ row }) => { return (
{ e.stopPropagation(); }} >
); }, }, ];