From 63e2d09e140057a0bf90fdab05bcd4f06bc9232f Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Merino Date: Fri, 12 Jul 2024 17:40:25 +0200 Subject: Pages: File: Formatting --- src/pages/File.tsx | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src') 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 ( <>
- {filepath} + { + formatFilePathAsName(filepath as string)// TODO: Filepath could be null + }
- {latestFile && - } +
+ {latestFile && + } +
- {files.map((file: FSTracerFile) => ( -
-

{file.absolute_path} - {file.timestamp}

-
- )) - } +
+ {files.map((file: FSTracerFile) => ( +
+

{file.absolute_path} - {file.timestamp}

+
+ )) + } +
-- cgit 1.4.1