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.tsx21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
index baa4ad521..e5a90ab4a 100644
--- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
+++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
@@ -39,6 +39,7 @@ import { AudioBox } from '../../AudioBox';
import { DiagramBox } from '../../DiagramBox';
import { ImageField } from '../../../../../fields/URLField';
import { DashUploadUtils } from '../../../../../server/DashUploadUtils';
+import { DocCreatorMenu, Field, FieldUtils } from '../../DataVizBox/DocCreatorMenu';
dotenv.config();
@@ -398,6 +399,23 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
this.addCSVForAnalysis(doc, id);
};
+ @action
+ createImageInDash = async (url: string, title: string, id: string, data: string) => {
+ const doc = FieldUtils.ImageField(
+ {
+ tl: [0, 0],
+ br: [300, 300],
+ },
+ 300,
+ 300,
+ title,
+ url ?? '',
+ {}
+ );
+
+ return doc;
+ };
+
/**
* Creates a text document in the dashboard and adds it for analysis.
* @param title The title of the doc.
@@ -415,8 +433,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
break;
case 'image':
console.log('imageURL: ' + data);
- //DashUploadUtils.UploadImage(data!);
- doc = Docs.Create.ImageDocument(data || '', options);
+ doc = await this.createImageInDash(data || '', options.title as string, '', data || '');
break;
case 'pdf':
doc = Docs.Create.PdfDocument(data || '', options);