'use client' import { type ColumnDef } from '@tanstack/react-table' import { Abbr } from '@repo/ui/components/abbr' import { DataTableColumnDatetime, DataTableColumnSelect, DataTableColumnCpfCnpj, DataTableColumnHeaderSelect } from '@repo/ui/components/data-table' import { Avatar, AvatarFallback } from '@repo/ui/components/ui/avatar' import { initials } from '@repo/ui/lib/utils' // This type is used to define the shape of our data. // You can use a Zod schema here if you want. export type User = { id: string name: string email: string cpf?: string } export const columns: ColumnDef[] = [ { id: 'select', header: DataTableColumnHeaderSelect, cell: DataTableColumnSelect }, { header: 'Usuário', cell: ({ row }) => { const { name, email } = row.original return (
{initials(name)}
) } }, { accessorKey: 'cpf', header: 'CPF', cell: DataTableColumnCpfCnpj }, { accessorKey: 'lastLogin', header: 'Último accesso', cell: DataTableColumnDatetime }, { accessorKey: 'createDate', header: 'Cadastrado em', cell: DataTableColumnDatetime } ]