Grégoire Delattre 4b26080193
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Update redux state management
Use immer with native javascript objects instead of immutablejs.
2020-04-07 18:22:26 +02:00

39 lines
923 B
JavaScript

import React from "react";
import PropTypes from "prop-types";
import { PolochonUser } from "./user";
export const PolochonUsers = ({ id, users }) => {
if (users === null || users.size === 0) {
return null;
}
return (
<table className="table border border-light table-dark">
<thead className="thead-dark">
<tr>
<th scope="col">User</th>
<th scope="col">Status</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{users.map((user, index) => (
<PolochonUser
key={index}
polochonId={id}
id={user.id}
name={user.name}
initialToken={user.token}
initialActivated={user.polochon_activated}
/>
))}
</tbody>
</table>
);
};
PolochonUsers.propTypes = {
id: PropTypes.string.isRequired,
users: PropTypes.array.isRequired,
};