import { Table, TableHeader, TableBody, TableRow, TableCell, TableColumn, Button, Icon, Icons, Flexbox, Text, } from 'react-basics'; import { ROLES } from 'lib/constants'; import { labels } from 'components/messages'; import { useIntl } from 'react-intl'; const { Close } = Icons; export default function TeamMembersTable({ data = [] }) { const { formatMessage } = useIntl(); const columns = [ { name: 'username', label: formatMessage(labels.username), style: { flex: 4 } }, { name: 'role', label: formatMessage(labels.role) }, { name: 'action', label: '' }, ]; return ( {(column, index) => { return ( {column.label} ); }} {(row, keys, rowIndex) => { const rowData = { username: row?.user?.username, role: formatMessage( labels[Object.keys(ROLES).find(key => ROLES[key] === row.role) || labels.unknown], ), action: (
), }; return ( {(data, key, colIndex) => { return ( {data[key]} ); }} ); }}
); }