@@ -22,6 +22,8 @@ export default function Table({ state, data }) {
22
22
year : "numeric" ,
23
23
month : "short" ,
24
24
day : "2-digit" ,
25
+ hour : "2-digit" ,
26
+ minute : "2-digit" ,
25
27
} ) . format ( new Date ( date ) ) ,
26
28
} ,
27
29
status : { name : "Status" } ,
@@ -34,39 +36,59 @@ export default function Table({ state, data }) {
34
36
Download
35
37
</ a >
36
38
) : (
37
- "N/A "
39
+ "- "
38
40
) ,
39
41
} ,
40
42
} ;
41
43
42
44
return state === TABLE_STATES . LOADING_LAST_UPLOADS ? (
43
45
< div className = { style . content } >
44
- < h1 className = { style . title } > Loading last uploads...</ h1 >
46
+ < h1 className = { style . title } > Gathering status of older uploads...</ h1 >
45
47
</ div >
46
- ) : (
47
- data . length > 0 && (
48
- < div className = { style . content } >
49
- < h1 className = { style . title } > Past 24 Hours Upload Status </ h1 >
50
- < table className = { style . tableContent } >
48
+ ) : data . length > 0 ? (
49
+ < div className = { style . content } >
50
+ < h1 className = { style . title } > Past 24 Hours Upload Status </ h1 >
51
+ < table className = { style . tableContent } >
52
+ < thead >
51
53
< tr >
52
- { _ . map ( _ . values ( columns ) , ( { name } ) => (
53
- < th > { name } </ th >
54
+ { _ . map ( _ . values ( columns ) , ( { name } , i ) => (
55
+ < th key = { i } > { name } </ th >
54
56
) ) }
55
57
</ tr >
56
- { _ . map ( data , ( item ) => (
57
- < tr >
58
- { _ . map ( _ . keys ( columns ) , ( colKey ) => (
59
- < td >
58
+ </ thead >
59
+ < tbody >
60
+ { _ . map ( data , ( item , i ) => (
61
+ < tr key = { i } >
62
+ { _ . map ( _ . keys ( columns ) , ( colKey , j ) => (
63
+ < td key = { j } >
60
64
{ columns [ colKey ] . formatter
61
65
? columns [ colKey ] . formatter ( item [ colKey ] )
62
- : item [ colKey ] || "N/A " }
66
+ : item [ colKey ] || "- " }
63
67
</ td >
64
68
) ) }
65
69
</ tr >
66
70
) ) }
67
- </ table >
68
- </ div >
69
- )
71
+ </ tbody >
72
+ </ table >
73
+ </ div >
74
+ ) : (
75
+ < div className = { style . content } >
76
+ < h1 className = { style . title } > Past 24 Hours Upload Status</ h1 >
77
+ < table className = { style . tableContent } >
78
+ < thead >
79
+ < tr >
80
+ { _ . map ( _ . values ( columns ) , ( { name } , i ) => (
81
+ < th key = { i } > { name } </ th >
82
+ ) ) }
83
+ </ tr >
84
+ </ thead >
85
+ < tbody >
86
+ < tr >
87
+ < td colSpan = "4" > No records uploaded in the past 24 hours</ td >
88
+ </ tr >
89
+ </ tbody >
90
+ </ table >
91
+ </ div >
70
92
) ;
71
93
}
72
94
0 commit comments