feat: [US-023] - Add choice node from toolbar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2026-01-21 12:54:18 -03:00
co-authored by Claude Opus 4.5
parent 09327c2410
commit 4355601bdb
+15 -2
View File
@@ -97,8 +97,21 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) {
}, [getViewportCenter, setNodes]) }, [getViewportCenter, setNodes])
const handleAddChoice = useCallback(() => { 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(() => { const handleAddVariable = useCallback(() => {
// TODO: Implement in US-026 // TODO: Implement in US-026