2018-03-06 12:32:51 +01:00
|
|
|
import React from "react";
|
|
|
|
import {
|
|
|
|
registerComponent,
|
|
|
|
Components,
|
|
|
|
ComponentsTable
|
|
|
|
} 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) => (
|
|
|
|
<li key={i}>{typeof hoc.name === "string" ? hoc.name : hoc[0].name}</li>
|
|
|
|
))}
|
|
|
|
</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-03-06 12:32:51 +01:00
|
|
|
"name",
|
2018-02-03 10:55:07 +09:00
|
|
|
{
|
2018-03-06 12:32:51 +01: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-03-06 12:32:51 +01:00
|
|
|
registerComponent("Components", ComponentsDashboard);
|