diff options
author | Manuel Palenzuela Merino <manuel.palenzuela@datadoghq.com> | 2024-07-12 17:40:25 +0200 |
---|---|---|
committer | Manuel Palenzuela Merino <manuel.palenzuela@datadoghq.com> | 2024-07-12 17:40:25 +0200 |
commit | 63e2d09e140057a0bf90fdab05bcd4f06bc9232f (patch) | |
tree | b99302d3f482b83d74edbe3fdb49466701ccd072 | |
parent | Pages: File: Show more info about file (diff) | |
download | fs-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.tsx | 29 |
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> |