chore: intitial commit, starting seperating concerns for plan editor.
This commit is contained in:
@@ -12,6 +12,32 @@ type PlanEditorDialogProps = {
|
|||||||
description? : string;
|
description? : string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an action, as a step for a plan.
|
||||||
|
* @param type the type of action to build
|
||||||
|
* @param value the value of this action to build
|
||||||
|
* @param isGestureTag whether or not this action, restricted to gestures, is a tag.
|
||||||
|
* @returns An action
|
||||||
|
*/
|
||||||
|
function createAction(
|
||||||
|
type: ActionTypes,
|
||||||
|
value: string,
|
||||||
|
isGestureTag: boolean
|
||||||
|
): Action {
|
||||||
|
const id = crypto.randomUUID();
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case "speech":
|
||||||
|
return { id, text: value, type: "speech" };
|
||||||
|
case "gesture":
|
||||||
|
return { id, gesture: value, isTag: isGestureTag, type: "gesture" };
|
||||||
|
case "llm":
|
||||||
|
return { id, goal: value, type: "llm" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default function PlanEditorDialog({
|
export default function PlanEditorDialog({
|
||||||
plan,
|
plan,
|
||||||
onSave,
|
onSave,
|
||||||
|
|||||||
Reference in New Issue
Block a user