{
+ logImEXEvent("dashboard_add_component", {name: e});
+ setState({
+ ...state,
+ items: [
+ ...state.items,
+ {
+ i: e.key,
+ x: (state.items.length * 2) % (state.cols || 12),
+ y: 99, // puts it at the bottom
+ w: componentList[e.key].w || 2,
+ h: componentList[e.key].h || 2,
+ },
+ ],
+ });
+ };
+
+ const dashboarddata = React.useMemo(
+ () => GenerateDashboardData(data),
+ [data]
+ );
+ const existingLayoutKeys = state.items.map((i) => i.i);
+ const addComponentOverlay = (
+
+ );
+
+ if (error) return
;
+
+ return (
+
+
+
+
+
+
+
+ }
+ />
+
+
-
- handleRemoveComponent(item.i)}
- />
-
-
-
- );
- })}
-
-
- );
+ {state.items.map((item, index) => {
+ const TheComponent = componentList[item.i].component;
+ return (
+