import { Button, Text, Icon, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Flexbox, Icons, ModalTrigger, Modal, } from 'react-basics'; import { formatDistance } from 'date-fns'; import Link from 'next/link'; import useUser from 'hooks/useUser'; import UserDeleteForm from './UserDeleteForm'; import { ROLES } from 'lib/constants'; import useMessages from 'hooks/useMessages'; export default function UsersTable({ data = [], onDelete }) { const { formatMessage, labels } = useMessages(); const { user } = useUser(); const columns = [ { name: 'username', label: formatMessage(labels.username), style: { flex: 2 } }, { name: 'role', label: formatMessage(labels.role), style: { flex: 1 } }, { name: 'created', label: formatMessage(labels.created), style: { flex: 1 } }, { name: 'action', label: ' ', style: { flex: 2 } }, ]; return (