+
+ {/* Left Side (Action Adder) */}
+
Add Action
+ {(!plan && description && draftPlan.steps.length === 0) && (
+
+
+
)}
+
+
+ {/* Action value editor*/}
+ {newActionType === "gesture" ? (
+ // Gesture get their own editor component
+
+ ) : (
+
+ )}
+
+ {/* Adding steps */}
+
+
+
+ {/* Right Side (Steps shown) */}
+
+
Steps
+
+ {/* Show if there are no steps yet */}
+ {draftPlan.steps.length === 0 && (
+
+ No steps yet
+
+ )}
+
+
+ {/* Map over all steps */}
+ {draftPlan.steps.map((step, index) => (
+
{
+ if (e.key === "Enter" || e.key === " ") {
+ setDraftPlan({
+ ...draftPlan,
+ steps: draftPlan.steps.filter((s) => s.id !== step.id),});
+ }}}
+ onClick={() => {
+ setDraftPlan({
+ ...draftPlan,
+ steps: draftPlan.steps.filter((s) => s.id !== step.id),});
+ }}>
+
+ {index + 1}.
+ {step.type}:
+ {
+ step.type == "goal" ? ""/* TODO: Add support for goals */
+ : GetActionValue(step)}
+
+
+ ))}
+
+
+ )}
+
+ {/* Buttons */}
+