diff --git a/src/app/editor/[projectId]/FlowchartEditor.tsx b/src/app/editor/[projectId]/FlowchartEditor.tsx index ba5a02c..7031f8b 100644 --- a/src/app/editor/[projectId]/FlowchartEditor.tsx +++ b/src/app/editor/[projectId]/FlowchartEditor.tsx @@ -97,8 +97,21 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) { }, [getViewportCenter, setNodes]) const handleAddChoice = useCallback(() => { - // TODO: Implement in US-023 - }, []) + const position = getViewportCenter() + const newNode: Node = { + id: nanoid(), + type: 'choice', + position, + data: { + prompt: '', + options: [ + { id: nanoid(), label: '' }, + { id: nanoid(), label: '' }, + ], + }, + } + setNodes((nodes) => [...nodes, newNode]) + }, [getViewportCenter, setNodes]) const handleAddVariable = useCallback(() => { // TODO: Implement in US-026