feat: [US-026] - Add variable 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 14:44:11 -03:00
parent 3453ba7492
commit e9916d9897
1 changed files with 13 additions and 2 deletions

View File

@ -116,8 +116,19 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) {
}, [getViewportCenter, setNodes]) }, [getViewportCenter, setNodes])
const handleAddVariable = useCallback(() => { 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(() => { const handleSave = useCallback(() => {
// TODO: Implement in US-034 // TODO: Implement in US-034