diff --git a/src/app/editor/[projectId]/FlowchartEditor.tsx b/src/app/editor/[projectId]/FlowchartEditor.tsx index 8567611..1942a47 100644 --- a/src/app/editor/[projectId]/FlowchartEditor.tsx +++ b/src/app/editor/[projectId]/FlowchartEditor.tsx @@ -116,8 +116,19 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) { }, [getViewportCenter, setNodes]) const handleAddVariable = useCallback(() => { - // TODO: Implement in US-026 - }, []) + const position = getViewportCenter() + const newNode: Node = { + id: nanoid(), + type: 'variable', + position, + data: { + variableName: '', + operation: 'set', + value: 0, + }, + } + setNodes((nodes) => [...nodes, newNode]) + }, [getViewportCenter, setNodes]) const handleSave = useCallback(() => { // TODO: Implement in US-034