Files
SCM-Manager/scm-ui/src/users/containers/UserTable.js

38 lines
826 B
JavaScript
Raw Normal View History

2018-07-11 17:02:38 +02:00
// @flow
import React from "react";
import UserRow from "./UserRow";
import type { User } from "../types/User";
type Props = {
2018-07-12 16:02:37 +02:00
entries: [{ loading: boolean, error: Error, user: User }],
2018-07-11 17:02:38 +02:00
deleteUser: string => void
};
class UserTable extends React.Component<Props> {
render() {
2018-07-12 16:02:37 +02:00
const { deleteUser } = this.props;
const entries = this.props.entries;
2018-07-11 17:02:38 +02:00
return (
<table>
<thead>
<tr>
<th>Name</th>
<th>Display Name</th>
<th>E-Mail</th>
<th>Admin</th>
</tr>
</thead>
<tbody>
2018-07-12 16:02:37 +02:00
{entries.map((entry, index) => {
return (
<UserRow key={index} entry={entry} deleteUser={deleteUser} />
);
2018-07-11 17:02:38 +02:00
})}
</tbody>
</table>
);
}
}
export default UserTable;