aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx')
-rw-r--r--src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
index 95f3fbc5d..d85f9d82e 100644
--- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
+++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
@@ -495,7 +495,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
doc = DocCast(Docs.Create.WebDocument(data, options));
break;
case 'comparison':
- doc = Docs.Create.ComparisonDocument('', options);
+ doc = this.createComparison(data, options);
break;
case 'diagram':
doc = Docs.Create.DiagramDocument(options);
@@ -631,6 +631,21 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
// return carouselDoc;
};
+ @action
+ createComparison = (doc: any, options: any) => {
+ const comp = Docs.Create.ComparisonDocument(options.title, { _width: options.width, _height: options.height | 300, backgroundColor: options.backgroundColor });
+ const [left, right] = doc;
+ console.log(DocCast(comp.dataDoc));
+ console.log(DocCast(comp[DocData]));
+ console.log(DocCast(comp[DocData].data_back));
+ const docLeft = DocCast(Docs.Create.TextDocument(left.data, { backgroundColor: left.backgroundColor, _width: left.width, _height: left.height }));
+ const docRight = DocCast(Docs.Create.TextDocument(right.data, { backgroundColor: right.backgroundColor, _width: right.width, _height: right.height }));
+ comp[DocData].data_back = docLeft;
+ comp[DocData].data_front = docRight;
+
+ return comp;
+ };
+
/**
* Event handler to manage citations click in the message components.
* @param citation The citation object clicked by the user.