+
+
+
+ onFieldChange(section, index, "name", e.target.value)
+ }
+ />
+
+
+
+ {field.type !== "object" && (
+
+ onCustomizableChange(section, index, e.target.checked)
+ }
+ />
+ }
+ label="Customizable"
+ />
+ )}
+ {field.type === "object" && (
+ handleAddNestedField(index)}
+ >
+
+
+ )}
+ handleRemoveField(section, index)}
+ style={{ marginLeft: "10px" }}
+ >
+
+
+
+
+
+
+ onFieldChange(section, index, "description", e.target.value)
+ }
+ />
+
+ {field.customizable && field.type !== "object" && (
+
+
+ onFieldChange(
+ section,
+ index,
+ "default",
+ field.type === "integer"
+ ? parseInt(e.target.value)
+ : e.target.value
+ )
+ }
+ />
+
+ )}
+ {field.fields && field.fields.length > 0 && (
+
+ {
+ const updatedFields = [...fields];
+ updatedFields[index].fields![nestedIndex][nestedField] =
+ nestedValue;
+ handleFieldChange(
+ section,
+ index,
+ "fields",
+ updatedFields[index].fields
+ );
+ }}
+ handleCustomizableChange={(
+ nestedSection,
+ nestedIndex,
+ nestedValue
+ ) => {
+ const updatedFields = [...fields];
+ updatedFields[index].fields![nestedIndex].customizable =
+ nestedValue;
+ handleFieldChange(
+ section,
+ index,
+ "fields",
+ updatedFields[index].fields
+ );
+ }}
+ handleAddField={handleAddField}
+ removeField={(nestedSection, nestedIndex) => {
+ const updatedFields = [...fields];
+ updatedFields[index].fields = updatedFields[
+ index
+ ].fields!.filter((_, i) => i !== nestedIndex);
+ handleFieldChange(
+ section,
+ index,
+ "fields",
+ updatedFields[index].fields
+ );
+ }}
+ />
+
+ )}
+