+ {creating && (
+
+ setCreating(null)}
+ onSubmit={async (value) => {
+ const ok = await send("/api/runtimes", "POST", { ...value, preset: creating.preset });
+ if (ok) {
+ toast.success(`Runtime "${value.name}" added`);
+ setCreating(null);
+ router.refresh();
+ }
+ return ok;
+ }}
+ />
+
+ )}
+ {runtimes.length === 0 && !creating && No runtimes yet. Add one from a preset.
}
+ {runtimes.map((r) =>
+ editing === r.id ? (
+
+ setEditing(null)}
+ onSubmit={async (value) => {
+ const ok = await send(`/api/runtimes/${r.id}`, "PUT", value);
+ if (ok) {
+ setEditing(null);
+ router.refresh();
+ }
+ return ok;
+ }}
+ />
+
+ ) : (
+ setEditing(r.id)}
+ onDuplicate={() => setCreating({ ...toInput(r), name: `${r.name} (copy)` })}
+ />
+ ),
+ )}
+
+