diff --git a/src/visualProgrammingUI/components/DragDropSidebar.tsx b/src/visualProgrammingUI/components/DragDropSidebar.tsx index 9c1e3dd..219e3a2 100644 --- a/src/visualProgrammingUI/components/DragDropSidebar.tsx +++ b/src/visualProgrammingUI/components/DragDropSidebar.tsx @@ -72,14 +72,41 @@ export function Sidebar() { if (isInFlow) { const position = screenToFlowPosition(screenPosition); - const newNode = { - id: getId(), - type: nodeType, - position, - data: { label: `${nodeType} node` }, - }; + const newNode = () => { + switch (nodeType) { + case "phase": + return { + id: getId(), + type: nodeType, + position, + data: {label: `"new"`, number: (-1)}, + }; + case "start": + return { + id: getId(), + type: nodeType, + position, + data: {label: `new start node`}, + }; + case "end": + return { + id: getId(), + type: nodeType, + position, + data: {label: `new end node`}, + }; + default: { + return { + id: getId(), + type: nodeType, + position, + data: {label: `new default node`}, + }; + } + } + } - setNodes((nds) => nds.concat(newNode)); + setNodes((nds) => nds.concat(newNode())); } }, [setNodes, screenToFlowPosition],