about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela Merino <manuel.palenzuela@datadoghq.com>2024-07-12 17:40:25 +0200
committerManuel Palenzuela Merino <manuel.palenzuela@datadoghq.com>2024-07-12 17:40:25 +0200
commit63e2d09e140057a0bf90fdab05bcd4f06bc9232f (patch)
treeb99302d3f482b83d74edbe3fdb49466701ccd072
parentPages: File: Show more info about file (diff)
downloadfs-tracer-frontend-63e2d09e140057a0bf90fdab05bcd4f06bc9232f.tar.gz
fs-tracer-frontend-63e2d09e140057a0bf90fdab05bcd4f06bc9232f.tar.bz2
fs-tracer-frontend-63e2d09e140057a0bf90fdab05bcd4f06bc9232f.zip
Pages: File: Formatting
-rw-r--r--src/pages/File.tsx29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/pages/File.tsx b/src/pages/File.tsx
index 2f940de..be611eb 100644
--- a/src/pages/File.tsx
+++ b/src/pages/File.tsx
@@ -42,25 +42,36 @@ export default function File(props: any) {
     fetchFiles()
   }, [])
 
+  const formatFilePathAsName = (filepath: string) => {
+    const parts = filepath.split('/')
+    return parts[parts.length - 1]
+  }
+
   return (
     <>
       <div className="flex h-screen">
         <SideBar />
         <main className="flex-1 overflow-y-auto my-4">
           <div className="flex flex-col items-center">
-            {filepath}
+            {
+              formatFilePathAsName(filepath as string)// TODO: Filepath could be null
+            }
           </div>
           <div className="mt-5 flex flex-col items-center">
-            {latestFile && <FileInfo file={latestFile} />
-            }
+            <div className="border rounded py-5 px-5">
+              {latestFile && <FileInfo file={latestFile} />
+              }
+            </div>
           </div>
           <div className="mt-5 flex flex-col items-center">
-            {files.map((file: FSTracerFile) => (
-              <div key={file.id}>
-                <p>{file.absolute_path} - {file.timestamp}</p>
-              </div>
-            ))
-            }
+            <div className="border rounded py-5 px-5">
+              {files.map((file: FSTracerFile) => (
+                <div key={file.id}>
+                  <p>{file.absolute_path} - {file.timestamp}</p>
+                </div>
+              ))
+              }
+            </div>
           </div>
         </main>
       </div>