"use client"; import { ColumnDef } from "@tanstack/react-table"; import { DateWithTime } from "@/components/ui/entities"; import { DataTableColumnHeader } from "@/components/ui/table"; import { InvitationProps } from "@/types"; import { DataTableRowActions } from "./data-table-row-actions"; const getInvitationData = (row: { original: InvitationProps }) => { return row.original.attributes; }; export const ColumnsInvitation: ColumnDef[] = [ { accessorKey: "email", header: ({ column }) => ( ), cell: ({ row }) => { const data = getInvitationData(row); return

{data?.email || "N/A"}

; }, enableSorting: false, }, { accessorKey: "state", header: ({ column }) => ( ), cell: ({ row }) => { const { state } = getInvitationData(row); return

{state}

; }, }, { accessorKey: "role", header: ({ column }) => ( ), cell: ({ row }) => { const roleName = row.original.relationships?.role?.attributes?.name || "No Role"; return

{roleName}

; }, enableSorting: false, }, { accessorKey: "inserted_at", header: ({ column }) => ( ), cell: ({ row }) => { const { inserted_at } = getInvitationData(row); return ; }, }, { accessorKey: "expires_at", header: ({ column }) => ( ), cell: ({ row }) => { const { expires_at } = getInvitationData(row); return ; }, }, { accessorKey: "actions", header: ({ column }) => ( ), id: "actions", cell: ({ row }) => { const roles = row.original.roles; return ; }, enableSorting: false, }, ];