feat: [US-026] - Add variable node from toolbar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3453ba7492
commit
e9916d9897
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue