2018-07-11 17:02:38 +02:00
|
|
|
// @flow
|
|
|
|
|
import React from "react";
|
2018-07-24 16:04:55 +02:00
|
|
|
import { translate } from "react-i18next";
|
2018-07-11 17:02:38 +02:00
|
|
|
import UserRow from "./UserRow";
|
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-24 16:04:55 +02:00
|
|
|
t: string => string,
|
2018-07-25 13:21:49 +02:00
|
|
|
entries: Array<UserEntry>
|
2018-07-11 17:02:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class UserTable extends React.Component<Props> {
|
|
|
|
|
render() {
|
2018-07-25 13:21:49 +02:00
|
|
|
const { entries, t } = this.props;
|
2018-07-11 17:02:38 +02:00
|
|
|
return (
|
2018-07-18 09:35:16 +02:00
|
|
|
<table className="table is-hoverable is-fullwidth">
|
2018-07-11 17:02:38 +02:00
|
|
|
<thead>
|
|
|
|
|
<tr>
|
2018-07-25 13:21:49 +02:00
|
|
|
<th className="is-hidden-mobile">{t("user.name")}</th>
|
2018-07-24 16:04:55 +02:00
|
|
|
<th>{t("user.displayName")}</th>
|
|
|
|
|
<th>{t("user.mail")}</th>
|
2018-07-25 13:21:49 +02:00
|
|
|
<th className="is-hidden-mobile">{t("user.admin")}</th>
|
2018-07-11 17:02:38 +02:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2018-07-12 16:02:37 +02:00
|
|
|
{entries.map((entry, index) => {
|
2018-07-25 13:21:49 +02:00
|
|
|
return <UserRow key={index} user={entry.entry} />;
|
2018-07-11 17:02:38 +02:00
|
|
|
})}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 16:04:55 +02:00
|
|
|
export default translate("users")(UserTable);
|