From 7082d37c07575afe29818c3a286e9b981e8bc307 Mon Sep 17 00:00:00 2001
From: Sophie Zhang <sophie_zhang@brown.edu>
Date: Wed, 31 Jan 2024 00:12:55 -0500
Subject: fix: got styling to work again

---
 src/client/views/nodes/trails/PresBox.tsx | 33 ++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 12 deletions(-)

(limited to 'src/client/views/nodes/trails/PresBox.tsx')

diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index b2059b185..b8b60d2a9 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -37,6 +37,12 @@ import { ScriptingBox } from '../ScriptingBox';
 import './PresBox.scss';
 import ReactLoading from 'react-loading';
 import { PresEffect, PresEffectDirection, PresMovement, PresStatus } from './PresEnums';
+import ReactTextareaAutosize from 'react-textarea-autosize';
+import { IconButton, Type } from 'browndash-components';
+import { BiMicrophone, BiX } from 'react-icons/bi';
+import { AiOutlineSend } from 'react-icons/ai';
+import { gptTrailSlideCustomization } from '../../../apis/gpt/customization';
+import { DictationManager } from '../../../util/DictationManager';
 export interface pinDataTypes {
     scrollable?: boolean;
     dataviz?: number[];
@@ -300,22 +306,24 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
 
     @action
     customizeWithGPT = async (input: string) => {
+        console.log(this.slideToModify);
         // const testInput = 'change title to Customized Slide, transition for 2.3s with fade in effect';
-        if (!this.slideToModify) return;
+        // if (!this.slideToModify) return;
         this.setIsRecording(false);
         this.setIsLoading(true);
         try {
             const res = await gptTrailSlideCustomization(input);
-            if (typeof res === 'string') {
-                const resObj = JSON.parse(res);
-                console.log('Result ', resObj);
-                // this.activeItem
-                for (let key in resObj) {
-                    if (resObj[key]) {
-                        this.slideToModify[key] = resObj[key];
-                    }
-                }
-            }
+            console.log('slide result', res);
+            // if (typeof res === 'string') {
+            //     const resObj = JSON.parse(res);
+            //     console.log('Result ', resObj);
+            //     // this.activeItem
+            //     for (let key in resObj) {
+            //         if (resObj[key]) {
+            //             this.slideToModify[key] = resObj[key];
+            //         }
+            //     }
+            // }
         } catch (err) {
             console.error(err);
         }
@@ -828,6 +836,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
      */
     navigateToActiveItem = (afterNav?: () => void) => {
         const activeItem: Doc = this.activeItem;
+        console.log('active item', activeItem);
         // GPT update
         this.slideToModify = activeItem;
         const targetDoc: Doc = this.targetDoc;
@@ -2749,7 +2758,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
                                 />
                             )}
                         </div>
-                        <TextareaAutosize
+                        <ReactTextareaAutosize
                             ref={r => (this._inputref = r)}
                             minRows={3}
                             placeholder="Customize..."
-- 
cgit v1.2.3-70-g09d2

