import Link from 'next/link'; import { Table, TableHeader, TableBody, TableRow, TableCell, TableColumn, Button, Icon, Flexbox, Icons, Text, ModalTrigger, Modal, } from 'react-basics'; import { useIntl } from 'react-intl'; import { labels } from 'components/messages'; import { ROLES } from 'lib/constants'; import TeamDeleteForm from './TeamDeleteForm'; export default function TeamsTable({ data = [], onDelete }) { const { formatMessage } = useIntl(); const columns = [ { name: 'name', label: formatMessage(labels.name), style: { flex: 2 } }, { name: 'owner', label: formatMessage(labels.owner) }, { name: 'action', label: ' ' }, ]; return ( {(column, index) => { return ( {column.label} ); }} {(row, keys, rowIndex) => { const { id } = row; const rowData = { ...row, owner: row.teamUser.find(({ role }) => role === ROLES.teamOwner)?.user?.username, action: ( {close => ( )} ), }; return ( {(data, key, colIndex) => { return ( {data[key]} ); }} ); }}
); }