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

36 lines
887 B
JavaScript
Raw Normal View History

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";
import type { User } from "../../types/User";
2018-07-11 17:02:38 +02:00
type Props = {
2018-07-24 16:04:55 +02:00
t: string => string,
users: User[]
2018-07-11 17:02:38 +02:00
};
class UserTable extends React.Component<Props> {
render() {
const { users, t } = this.props;
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>
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>
{users.map((user, index) => {
return <UserRow key={index} user={user} />;
2018-07-11 17:02:38 +02:00
})}
</tbody>
</table>
);
}
}
2018-07-24 16:04:55 +02:00
export default translate("users")(UserTable);