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
parent 09327c2410
commit 4355601bdb
1 changed files with 15 additions and 2 deletions

View File

@ -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