Vulcan/packages/nova-debug/lib/components/Groups.jsx

40 lines
855 B
React
Raw Normal View History

2016-07-21 12:38:11 +09:00
import React from 'react';
import { registerComponent } from 'meteor/nova:core';
2016-07-21 12:38:11 +09:00
import Users from 'meteor/nova:users';
const Group = ({name, actions}) => {
return (
<tr>
<td>{name}</td>
<td><ul>{actions.map(action => <li><code>{action}</code></li>)}</ul></td>
</tr>
)
}
const Groups = props => {
return (
<div className="groups">
<h1>Groups</h1>
<div className="groups-wrapper">
<table className="table">
<thead>
<tr>
<td><strong>Name</strong></td>
<td><strong>Actions</strong></td>
</tr>
</thead>
<tbody>
{_.map(Users.groups, (group, key) => <Group key={key} name={key} actions={group.actions} />)}
</tbody>
</table>
</div>
2016-07-21 12:38:11 +09:00
</div>
)
}
registerComponent('Groups', Groups);