1
- import { makeStyles } from "@mui/styles "
1
+ import Box from "@mui/material/Box "
2
2
import { WorkspaceBuild } from "api/typesGenerated"
3
- import { CodeExample } from "components/CodeExample/CodeExample"
4
- import { Stack } from "components/Stack/Stack"
3
+ import { AlertBanner } from "components/AlertBanner/AlertBanner"
5
4
6
5
const Language = {
7
6
stateMessage :
@@ -15,43 +14,26 @@ export interface WorkspaceBuildStateErrorProps {
15
14
export const WorkspaceBuildStateError : React . FC <
16
15
WorkspaceBuildStateErrorProps
17
16
> = ( { build } ) => {
18
- const styles = useStyles ( )
19
-
20
17
const orphanCommand = `coder rm ${
21
18
build . workspace_owner_name + "/" + build . workspace_name
22
19
} --orphan`
23
20
return (
24
- < Stack className = { styles . root } >
25
- < Stack direction = "row" alignItems = "center" className = { styles . messageBox } >
26
- < Stack direction = "row" spacing = { 0 } >
27
- < span className = { styles . errorMessage } >
28
- { Language . stateMessage } A template admin may run{ " " }
29
- < CodeExample inline code = { orphanCommand } /> to delete the workspace
30
- skipping resource destruction.
31
- </ span >
32
- </ Stack >
33
- </ Stack >
34
- </ Stack >
21
+ < AlertBanner
22
+ severity = "error"
23
+ text = {
24
+ < Box >
25
+ { Language . stateMessage } A template admin may run{ " " }
26
+ < Box
27
+ component = "code"
28
+ display = "inline-block"
29
+ width = "fit-content"
30
+ fontWeight = { 600 }
31
+ >
32
+ `{ orphanCommand } `
33
+ </ Box > { " " }
34
+ to delete the workspace skipping resource destruction.
35
+ </ Box >
36
+ }
37
+ > </ AlertBanner >
35
38
)
36
39
}
37
-
38
- const useStyles = makeStyles ( ( theme ) => ( {
39
- root : {
40
- background : theme . palette . warning . main ,
41
- padding : theme . spacing ( 2 ) ,
42
- borderRadius : theme . shape . borderRadius ,
43
- gap : 0 ,
44
- } ,
45
- flex : {
46
- display : "flex" ,
47
- } ,
48
- messageBox : {
49
- justifyContent : "space-between" ,
50
- } ,
51
- errorMessage : {
52
- marginRight : theme . spacing ( 1 ) ,
53
- } ,
54
- iconButton : {
55
- padding : 0 ,
56
- } ,
57
- } ) )
0 commit comments