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

47 lines
1.0 KiB
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";
2018-07-17 11:29:58 +02:00
import type { UserEntry } from "../types/UserEntry";
2018-07-11 17:02:38 +02:00
type Props = {
2018-07-17 11:29:58 +02:00
entries: Array<UserEntry>,
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 className="table is-hoverable is-fullwidth">
2018-07-11 17:02:38 +02:00
<thead>
<tr>
<th>Name</th>
<th>Display Name</th>
<th>E-Mail</th>
<th>Admin</th>
<th />
<th />
2018-07-11 17:02:38 +02:00
</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;