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

45 lines
1005 B
JavaScript
Raw Normal View History

2018-07-11 17:02:38 +02:00
// @flow
import React from "react";
import UserRow from "./UserRow";
2018-07-17 08:39:51 +02:00
import { editUser } from "../modules/users";
2018-07-11 17:02:38 +02:00
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-17 08:39:51 +02:00
deleteUser: string => void,
editUser: User => void
2018-07-11 17:02:38 +02:00
};
class UserTable extends React.Component<Props> {
render() {
2018-07-17 08:39:51 +02:00
const { deleteUser, editUser } = this.props;
2018-07-12 16:02:37 +02:00
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 (
2018-07-17 08:39:51 +02:00
<UserRow
key={index}
entry={entry}
deleteUser={deleteUser}
editUser={editUser}
/>
2018-07-12 16:02:37 +02:00
);
2018-07-11 17:02:38 +02:00
})}
</tbody>
</table>
);
}
}
export default UserTable;