+
+
+ }
+ placeholder="Search..."
+ emptyContent={No areas found
}
+ onSearch={(v) => handleStringSearch(v)}
+ onChange={(v) => setValue(v)}
+ onSelect={(v) => {
+ const { id } = areas.find((t) => t.name === v);
+ document
+ .getElementById(`scroll_area_${id}`)
+ .scrollIntoView({ behavior: "smooth" });
+ }}
+ className="w-full"
+ />
+
+
+ }
+ block
+ onClick={() => {
+ const newArea = {
+ id: areas.length,
+ name: `area_${areas.length}`,
+ x: 0,
+ y: 0,
+ width: 200,
+ height: 200,
+ color: defaultTableTheme,
+ };
+ setAreas((prev) => [...prev, newArea]);
+ }}
+ >
+ Add area
+
+
+
+ {areas.length <= 0 ? (
+
+
+ }
+ darkModeImage={
+
+ }
+ title="No subject areas"
+ description="Add subject areas to compartmentalize tables!"
+ />
+
+ ) : (
+
+ {areas.map((a, i) => (
+
+
+ updateArea(a.id, { name: value })}
+ field="name"
+ />
+
+
+
+
+
Theme
+
+
+
+
+
+ {tableThemes
+ .slice(0, Math.ceil(tableThemes.length / 2))
+ .map((c) => (
+
+ ))}
+
+
+ {tableThemes
+ .slice(Math.ceil(tableThemes.length / 2))
+ .map((c) => (
+
+ ))}
+
+
+
+ }
+ trigger="click"
+ position="bottomLeft"
+ showArrow
+ >
+
+
+
+
+
}
+ type="danger"
+ onClick={(e) => {
+ e.stopPropagation();
+ Toast.success(`Area deleted!`);
+ setAreas((prev) =>
+ prev
+ .filter((e) => e.id !== i)
+ .map((e, idx) => ({ ...e, id: idx }))
+ );
+ }}
+ // className="delete-button"
+ >
+
+
+ ))}
+
+ )}
+