|
|
|
@@ -0,0 +1,55 @@ |
|
|
|
import React from "react"; |
|
|
|
import PropTypes from "prop-types"; |
|
|
|
import TableCellCheckbox from "../common/TableCellCheckbox"; |
|
|
|
//import { Link } from "react-router-dom"; |
|
|
|
|
|
|
|
function UserList(props) { |
|
|
|
return ( |
|
|
|
<table className="table"> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<th>First Name</th> |
|
|
|
<th>Last Name</th> |
|
|
|
<th>Username</th> |
|
|
|
<th>Password</th> |
|
|
|
<th>Email</th> |
|
|
|
<th>Is Active</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
{props.users.map((user) => { |
|
|
|
return ( |
|
|
|
<tr key={user.id}> |
|
|
|
<td>{user.firstname}</td> |
|
|
|
<td>{user.lastname}</td> |
|
|
|
<td>{user.username}</td> |
|
|
|
<td>{user.password}</td> |
|
|
|
<td>{user.email}</td> |
|
|
|
<TableCellCheckbox |
|
|
|
id={user.id} |
|
|
|
name={user.firstname} |
|
|
|
checked={user.isactive} |
|
|
|
onChange={user.onChange} |
|
|
|
/> |
|
|
|
</tr> |
|
|
|
); |
|
|
|
})} |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
); |
|
|
|
} |
|
|
|
UserList.propTypes = { |
|
|
|
user: PropTypes.arrayOf( |
|
|
|
PropTypes.shape({ |
|
|
|
id: PropTypes.number.isRequired, |
|
|
|
firstname: PropTypes.string.isRequired, |
|
|
|
lastname: PropTypes.string.isRequired, |
|
|
|
username: PropTypes.string.isRequired, |
|
|
|
password: PropTypes.string.isRequired, |
|
|
|
email: PropTypes.string.isRequired, |
|
|
|
isactive: PropTypes.bool.isRequired, |
|
|
|
}) |
|
|
|
), |
|
|
|
}; |
|
|
|
|
|
|
|
export default UserList; |