@@ -9,6 +9,10 @@ import {
9
9
ImpendingDeletionText ,
10
10
} from "components/WorkspaceDeletion"
11
11
import { getDisplayWorkspaceStatus } from "utils/workspace"
12
+ import Tooltip , { TooltipProps , tooltipClasses } from "@mui/material/Tooltip"
13
+ import { styled } from "@mui/material/styles"
14
+ import Box from "@mui/material/Box"
15
+ import ErrorOutline from "@mui/icons-material/ErrorOutline"
12
16
13
17
export type WorkspaceStatusBadgeProps = {
14
18
workspace : Workspace
@@ -28,6 +32,27 @@ export const WorkspaceStatusBadge: FC<
28
32
< Cond condition = { Boolean ( LockedBadge ( { workspace } ) ) } >
29
33
< LockedBadge workspace = { workspace } />
30
34
</ Cond >
35
+ < Cond condition = { workspace . latest_build . status === "failed" } >
36
+ < FailureTooltip
37
+ title = {
38
+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1.25 } } >
39
+ < ErrorOutline
40
+ sx = { {
41
+ width : 14 ,
42
+ height : 14 ,
43
+ color : ( theme ) => theme . palette . error . light ,
44
+ } }
45
+ />
46
+ < Box > { workspace . latest_build . job . error } </ Box >
47
+ </ Box >
48
+ }
49
+ placement = "top"
50
+ >
51
+ < div >
52
+ < Pill className = { className } icon = { icon } text = { text } type = { type } />
53
+ </ div >
54
+ </ FailureTooltip >
55
+ </ Cond >
31
56
< Cond >
32
57
< Pill className = { className } icon = { icon } text = { text } type = { type } />
33
58
</ Cond >
@@ -66,6 +91,17 @@ export const WorkspaceStatusText: FC<
66
91
)
67
92
}
68
93
94
+ const FailureTooltip = styled ( ( { className, ...props } : TooltipProps ) => (
95
+ < Tooltip { ...props } classes = { { popper : className } } />
96
+ ) ) ( ( { theme } ) => ( {
97
+ [ `& .${ tooltipClasses . tooltip } ` ] : {
98
+ backgroundColor : theme . palette . background . paperLight ,
99
+ border : `1px solid ${ theme . palette . divider } ` ,
100
+ fontSize : 12 ,
101
+ padding : theme . spacing ( 1 , 1.25 ) ,
102
+ } ,
103
+ } ) )
104
+
69
105
const useStyles = makeStyles ( ( theme ) => ( {
70
106
root : { fontWeight : 600 } ,
71
107
"type-error" : {
0 commit comments