2018-09-16 11:48:38 +09:00
|
|
|
import React from 'react';
|
2018-03-06 12:32:51 +01:00
|
|
|
import {
|
|
|
|
registerComponent,
|
|
|
|
Components,
|
|
|
|
ComponentsTable
|
2018-09-16 11:48:38 +09:00
|
|
|
} from 'meteor/vulcan:lib';
|
2018-02-03 10:55:07 +09:00
|
|
|
|
2018-03-06 12:32:51 +01:00
|
|
|
const ComponentHOCs = ({ document }) => (
|
|
|
|
<div>
|
|
|
|
<ul>
|
|
|
|
{document.hocs.map((hoc, i) => (
|
2018-09-16 11:48:38 +09:00
|
|
|
<li key={i}>{typeof hoc.name === 'string' ? hoc.name : hoc[0].name}</li>
|
2018-03-06 12:32:51 +01:00
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
);
|
2018-02-03 10:55:07 +09:00
|
|
|
|
2018-03-06 12:32:51 +01:00
|
|
|
const ComponentsDashboard = props => (
|
2018-02-03 10:55:07 +09:00
|
|
|
<div className="components">
|
|
|
|
<Components.Datatable
|
|
|
|
showSearch={false}
|
|
|
|
showNew={false}
|
|
|
|
showEdit={false}
|
|
|
|
data={Object.values(ComponentsTable)}
|
|
|
|
columns={[
|
2018-09-16 11:48:38 +09:00
|
|
|
'name',
|
2018-02-03 10:55:07 +09:00
|
|
|
{
|
2018-09-16 11:48:38 +09:00
|
|
|
name: 'hocs',
|
2018-02-03 10:55:07 +09:00
|
|
|
component: ComponentHOCs
|
2018-03-06 12:32:51 +01:00
|
|
|
}
|
2018-02-03 10:55:07 +09:00
|
|
|
]}
|
|
|
|
/>
|
|
|
|
</div>
|
2018-03-06 12:32:51 +01:00
|
|
|
);
|
2018-02-03 10:55:07 +09:00
|
|
|
|
2018-09-16 11:48:38 +09:00
|
|
|
registerComponent('Components', ComponentsDashboard);
|