import { Button, Text, Icon, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Flexbox, Icons, ModalTrigger, Modal, } from 'react-basics'; import { useIntl } from 'react-intl'; import { formatDistance } from 'date-fns'; import Link from 'next/link'; import useUser from 'hooks/useUser'; import UserDeleteForm from './UserDeleteForm'; import { labels } from 'components/messages'; import { ROLES } from 'lib/constants'; export default function UsersTable({ data = [], onDelete }) { const { formatMessage } = useIntl(); 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 (