From c685102e96ce0f082b21299eaf7aaaaaf60087bd Mon Sep 17 00:00:00 2001
From: ali asaria <aliasaria@users.noreply.github.com>
Date: Wed, 5 Mar 2025 11:16:53 -0500
Subject: [PATCH] use components instead of functions for folder vs file

---
 src/renderer/components/Experiment/Rag/Documents.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/renderer/components/Experiment/Rag/Documents.tsx b/src/renderer/components/Experiment/Rag/Documents.tsx
index bd14c862..81b31a9c 100644
--- a/src/renderer/components/Experiment/Rag/Documents.tsx
+++ b/src/renderer/components/Experiment/Rag/Documents.tsx
@@ -211,7 +211,7 @@ export default function Documents({
     }
   };
 
-  function drawFile(row) {
+  function File({ row }) {
     return (
       <tr key={row?.name}>
         {/* <td style={{ textAlign: 'center', width: 120 }}>
@@ -310,7 +310,7 @@ export default function Documents({
     );
   }
 
-  function drawFolder(row) {
+  function Folder({ row }) {
     return (
       <tr key={row?.name} onDoubleClick={() => setCurrentFolder(row?.name)}>
         <td style={{ paddingLeft: '1rem' }}>
@@ -724,7 +724,11 @@ export default function Documents({
                     </tr>
                   )}
                   {stableSort(rows, getComparator(doc, 'id'))?.map((row) =>
-                    row?.type === 'folder' ? drawFolder(row) : drawFile(row),
+                    row?.type === 'folder' ? (
+                      <Folder row={row} />
+                    ) : (
+                      <File row={row} />
+                    ),
                   )}
                 </tbody>
               </Table>
-- 
GitLab