39 lines
923 B
JavaScript
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,
|
|
};
|