import { useState } from 'react'; import { getDescendants } from '../utils/tree'; import { useConversation } from '../context/ConversationContext'; export default function BranchDialog({ node, onClose, onConfirm }) { const { state } = useConversation(); const conv = state.conversations[state.activeConversationId]; const [editedMessage, setEditedMessage] = useState(node.userMessage); const descendantCount = conv ? getDescendants(conv.nodes, node.id).length : 0; const handleConfirm = () => { onConfirm(node.id, editedMessage); onClose(); }; return (
Edit the prompt below to create an alternate conversation path.