feat: [US-023] - Add choice node from toolbar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
09327c2410
commit
4355601bdb
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue