@@ -19,17 +19,22 @@ export const WorkspaceLastUsed: FC<WorkspaceLastUsedProps> = ({ lastUsedAt }) =>
19
19
let color = theme . palette . text . secondary
20
20
let message = t . fromNow ( )
21
21
22
- if ( t . isBefore ( now . subtract ( 100 , "year" ) ) ) {
23
- color = theme . palette . error . main
24
- message = "Never"
25
- } else if ( t . isBefore ( now . subtract ( 1 , "month" ) ) ) {
26
- color = theme . palette . warning . light
27
- } else if ( t . isAfter ( now . subtract ( 24 , "hour" ) ) ) {
28
- // Since the agent reports on a regular interval,
22
+ if ( t . isAfter ( now . subtract ( 1 , "hour" ) ) ) {
23
+ color = theme . palette . success . main
24
+ // Since the agent reports on a 10m interval,
25
+ // the last_used_at can be inaccurate when recent.
29
26
// we default to "Today" instead of showing a
30
27
// potentially inaccurate value.
31
- color = theme . palette . success . main
32
- message = "Today"
28
+ message = "Last Hour"
29
+ } else if ( t . isAfter ( now . subtract ( 1 , "day" ) ) ) {
30
+ color = theme . palette . primary . main
31
+ } else if ( t . isAfter ( now . subtract ( 1 , "month" ) ) ) {
32
+ color = theme . palette . text . secondary
33
+ } else if ( t . isAfter ( now . subtract ( 100 , "year" ) ) ) {
34
+ color = theme . palette . warning . light
35
+ } else {
36
+ color = theme . palette . error . light
37
+ message = "Never"
33
38
}
34
39
35
40
return < span style = { { color : color } } > { message } </ span >
0 commit comments