From c5b2912cc4f44c5e12d8b5dc123d99bf9c4d9b85 Mon Sep 17 00:00:00 2001
From: alyssaf16 <alyssa_feinberg@brown.edu>
Date: Wed, 17 Apr 2024 13:17:51 -0400
Subject: ai flashcards

---
 src/client/views/pdf/GPTPopup/GPTPopup.tsx | 42 +++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 15 deletions(-)

(limited to 'src/client/views/pdf/GPTPopup/GPTPopup.tsx')

diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
index dbcdd4e3a..32c1721ec 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
@@ -144,6 +144,15 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> {
             _layout_autoHeight: true,
         });
         this.addDoc(newDoc, this.sidebarId);
+        // const arr = [newDoc];
+        // const newCol = Docs.Create.CarouselDocument(arr, {
+        //     _width: 200,
+        //     _height: 200,
+        //     _layout_fitWidth: true,
+        //     _layout_autoHeight: true,
+        // });
+        // this.addDoc(newDoc, this.sidebarId);
+        // this.addDoc(newCol, this.sidebarId);
         const anchor = AnchorMenu.Instance?.GetAnchor(undefined, false);
         if (anchor) {
             DocUtils.MakeLink(newDoc, anchor, {
@@ -152,21 +161,24 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> {
         }
     };
 
-    transferToFlashcard = () => {
-        const senArr = this.text.split('.');
-        for (var i = 0; i < senArr.length; i += 2) {
-            console.log('SEN: ' + senArr[i]);
-            const newDoc = Docs.Create.ComparisonDocument(senArr[i], { _layout_isFlashcard: true, _width: 300, _height: 300 });
-            newDoc.text = senArr[i];
-            this.addDoc(newDoc, this.sidebarId);
-            const anchor = AnchorMenu.Instance?.GetAnchor(undefined, false);
-            if (anchor) {
-                DocUtils.MakeLink(newDoc, anchor, {
-                    link_relationship: 'GPT Summary',
-                });
-            }
-        }
-    };
+    // transferToFlashcard = () => {
+    //     const senArr = this.text.split('Question');
+    //     const collectionArr: Doc[] = [];
+    //     for (var i = 1; i < senArr.length; i++) {
+    //         console.log('Arr ' + i + ': ' + senArr[i]);
+    //         const newDoc = Docs.Create.ComparisonDocument(senArr[i], { _layout_isFlashcard: true, _width: 300, _height: 300 });
+    //         newDoc.text = senArr[i];
+    //         collectionArr.push(newDoc);
+    //     }
+    //     const newCol = Docs.Create.CarouselDocument(collectionArr, {
+    //         _width: 200,
+    //         _height: 200,
+    //         _layout_fitWidth: true,
+    //         _layout_autoHeight: true,
+    //     });
+    //     this.addDoc(newCol, this.sidebarId);
+    //     this.addToCollection?.(newCol);
+    // };
 
     /**
      * Transfers the image urls to actual image docs
-- 
cgit v1.2.3-70-g09d2

