import { Link } from '@inertiajs/react'; import type { ColumnDef } from '@tanstack/react-table'; import { KeyRound, Pencil, Trash2 } from 'lucide-react'; import { DataTableColumnHeader } from '@/components/data-table-column-header'; import { Button } from '@/components/ui/button'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; import { UserInfo } from '@/components/user-info'; import userRoutes from '@/routes/user'; import type { User } from '@/types'; interface ColumnProps { onResetPassword: (user: User) => void; onDelete: (user: User) => void; } export const getColumns = ({ onResetPassword, onDelete }: ColumnProps): ColumnDef[] => [ { accessorKey: "name", header: ({ column }) => ( ), meta: { title: "Nama dan Alamat Surel" }, cell: ({ row }) => { const user = row.original; return (
); } }, { accessorKey: "username", header: ({ column }) => ( ), meta: { title: "Nama Pengguna" }, }, { accessorFn: (row) => row.profile?.phone_number, id: "phone_number", header: ({ column }) => ( ), meta: { title: "Nomor Telepon" }, }, { id: "actions", header: "Aksi", cell: ({ row }) => { const user = row.original; return (

Reset Kata Sandi

Ubah

Hapus

); }, meta: { title: "Aksi" }, }, ];