({ data }: FlowNodeProps)
| 139 | } |
| 140 | |
| 141 | export function FlowNode({ data }: FlowNodeProps) { |
| 142 | const t = useT(); |
| 143 | // hover / click 由 ReactFlow 顶层的 onNodeMouseEnter / onNodeClick 统一处理(更可靠) |
| 144 | const clickable = !!data.path && data.kind !== "query" && data.kind !== "thought"; |
| 145 | |
| 146 | if (data.kind === "query") return renderQuery(data, t); |
| 147 | if (data.kind === "thought") return renderThought(data, t); |
| 148 | if (data.kind === "ghost") return renderGhost(data, clickable, t); |
| 149 | if (data.kind === "result") return renderResult(data, t); |
| 150 | if (data.kind === "warning") return renderWarning(data, t); |
| 151 | return renderTool(data, clickable, t); |
| 152 | } |
| 153 | |
| 154 | // ─── Warning 节点(AI 提前结束 / 流中断)─── |
| 155 | function renderWarning(data: FlowNodeData, t: TFn) { |
nothing calls this directly
no test coverage detected