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

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

; }, }, { accessorKey: "email", header: ({ column }) => ( ), cell: ({ row }) => { const { email } = getUserData(row); return

{email}

; }, }, { accessorKey: "role", header: () =>
Role
, cell: ({ row }) => { const { role } = getUserData(row); return

{role?.name || "No Role"}

; }, }, { accessorKey: "company_name", header: ({ column }) => ( ), cell: ({ row }) => { const { company_name } = getUserData(row); return

{company_name}

; }, }, { accessorKey: "date_joined", header: ({ column }) => ( ), cell: ({ row }) => { const { date_joined } = getUserData(row); return ; }, }, { accessorKey: "actions", header: () =>
Actions
, id: "actions", cell: ({ row }) => { const roles = row.original.roles; return ; }, }, ];