1
1
import Button from "@mui/material/Button"
2
2
import { makeStyles } from "@mui/styles"
3
- import RefreshOutlined from "@mui/icons-material/RefreshOutlined"
4
3
import { Avatar } from "components/Avatar/Avatar"
5
4
import { AgentRow } from "components/Resources/AgentRow"
6
5
import { WorkspaceBuildLogs } from "components/WorkspaceBuildLogs/WorkspaceBuildLogs"
@@ -12,7 +11,7 @@ import { FC } from "react"
12
11
import { useTranslation } from "react-i18next"
13
12
import { useNavigate } from "react-router-dom"
14
13
import * as TypesGen from "../../api/typesGenerated"
15
- import { Alert } from "../Alert/Alert"
14
+ import { Alert , AlertDetail } from "../Alert/Alert"
16
15
import { BuildsTable } from "../BuildsTable/BuildsTable"
17
16
import { Margins } from "../Margins/Margins"
18
17
import { Resources } from "../Resources/Resources"
@@ -31,6 +30,7 @@ import { ErrorAlert } from "components/Alert/ErrorAlert"
31
30
import { ImpendingDeletionBanner } from "components/WorkspaceDeletion"
32
31
import { useLocalStorage } from "hooks"
33
32
import { ChooseOne , Cond } from "components/Conditionals/ChooseOne"
33
+ import AlertTitle from "@mui/material/AlertTitle"
34
34
35
35
export enum WorkspaceErrors {
36
36
GET_BUILDS_ERROR = "getBuildsError" ,
@@ -209,32 +209,23 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
209
209
210
210
{ failedBuildLogs && (
211
211
< Stack >
212
- < Alert severity = "error" >
213
- < Stack
214
- className = { styles . fullWidth }
215
- direction = "row"
216
- alignItems = "center"
217
- justifyContent = "space-between"
218
- >
219
- < Stack spacing = { 0 } >
220
- < span > Workspace build failed</ span >
221
- < span className = { styles . errorDetails } >
222
- { workspace . latest_build . job . error }
223
- </ span >
224
- </ Stack >
225
-
226
- { canUpdateTemplate && (
227
- < div >
228
- < Button
229
- onClick = { handleBuildRetry }
230
- startIcon = { < RefreshOutlined /> }
231
- size = "small"
232
- >
233
- { t ( "actionButton.retryDebugMode" ) }
234
- </ Button >
235
- </ div >
236
- ) }
237
- </ Stack >
212
+ < Alert
213
+ severity = "error"
214
+ actions = {
215
+ canUpdateTemplate && (
216
+ < Button
217
+ key = { 0 }
218
+ onClick = { handleBuildRetry }
219
+ variant = "text"
220
+ size = "small"
221
+ >
222
+ { t ( "actionButton.retryDebugMode" ) }
223
+ </ Button >
224
+ )
225
+ }
226
+ >
227
+ < AlertTitle > Workspace build failed</ AlertTitle >
228
+ < AlertDetail > { workspace . latest_build . job . error } </ AlertDetail >
238
229
</ Alert >
239
230
< WorkspaceBuildLogs logs = { failedBuildLogs } />
240
231
</ Stack >
0 commit comments