File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,38 @@ export default function Admin(props) {
154154
155155 < Grid container item spacing = { 5 } direction = "row" style = { { padding : 20 } } >
156156 < Grid container item direction = "column" spacing = { 3 } sm = { 6 } >
157+ < Grid item >
158+ < Typography variant = "h5" > Latest Files</ Typography >
159+ </ Grid >
160+ < Grid item >
161+ { _ . isEmpty ( fileListHtml ) !== true &&
162+ < TableContainer component = { Paper } >
163+ < Table aria-label = "simple table" >
164+ < TableHead >
165+ < TableRow >
166+ < TableCell > < b > File Type</ b > </ TableCell >
167+ < TableCell > < b > Last Updated</ b > </ TableCell >
168+ </ TableRow >
169+ </ TableHead >
170+ < TableBody >
171+ { _ . map ( fileListHtml , ( file , index ) => {
172+ const fileName = file . split ( "-" ) [ 0 ] ;
173+ let fileDate = file . split ( "-" ) . slice ( 1 ) . join ( ) . split ( "." ) [ 0 ] ;
174+ let fileDateOnlyNumbers = fileDate . replaceAll ( "," , "" ) ;
175+ let fileDateFormatted = moment ( fileDateOnlyNumbers , "YYYYMMDDhmmss" ) . local ( ) . format ( "MMMM Do YYYY, h:mm:ss a" ) ;
176+
177+ return (
178+ < TableRow key = { index } >
179+ < TableCell > { fileName } </ TableCell >
180+ < TableCell > { fileDateFormatted } </ TableCell >
181+ </ TableRow >
182+ )
183+ } )
184+ }
185+ </ TableBody >
186+ </ Table >
187+ </ TableContainer > }
188+ </ Grid >
157189 < Grid item >
158190 < Paper >
159191 < CardContent >
You can’t perform that action at this time.
0 commit comments