From e94171fb18cefae934e9a6347c528eed3c2d3b47 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Wed, 18 Feb 2026 21:08:28 -0500 Subject: [PATCH] feat: add FlowCanvasAnswerNode stub card for React Flow canvas Co-Authored-By: Claude Opus 4.6 --- .../tree-editor/FlowCanvasAnswerNode.tsx | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 frontend/src/components/tree-editor/FlowCanvasAnswerNode.tsx diff --git a/frontend/src/components/tree-editor/FlowCanvasAnswerNode.tsx b/frontend/src/components/tree-editor/FlowCanvasAnswerNode.tsx new file mode 100644 index 00000000..2fd84eee --- /dev/null +++ b/frontend/src/components/tree-editor/FlowCanvasAnswerNode.tsx @@ -0,0 +1,69 @@ +import { memo, useState } from 'react' +import { Handle, Position, type NodeProps } from '@xyflow/react' +import { HelpCircle, Zap, CheckCircle } from 'lucide-react' +import { cn } from '@/lib/utils' +import type { TreeStructure } from '@/types' + +export interface FlowCanvasAnswerNodeData { + node: TreeStructure + onSelectType: (nodeId: string, type: 'decision' | 'action' | 'solution') => void +} + +function FlowCanvasAnswerNodeComponent({ data, selected }: NodeProps) { + const { node, onSelectType } = data as unknown as FlowCanvasAnswerNodeData + const [picking, setPicking] = useState(false) + const label = node.title || 'Answer' + + return ( + <> + + +
!picking && setPicking(true)} + > +
+ {label} +
+ + {!picking ? ( +
+ + Choose Type +
+ ) : ( +
+ + + +
+ )} +
+ + + + ) +} + +export const FlowCanvasAnswerNode = memo(FlowCanvasAnswerNodeComponent)