40 lines
973 B
JavaScript

import React from "react";
import PropTypes from "prop-types";
import { List } from "immutable";
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.get("id")}
name={user.get("name")}
initialToken={user.get("token")}
initialActivated={user.get("polochon_activated")}
/>
))}
</tbody>
</table>
);
};
PolochonUsers.propTypes = {
id: PropTypes.string,
users: PropTypes.instanceOf(List)
};