mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(site): Upgrade to MUI v5 (#7437)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { Theme } from "@material-ui/core/styles"
|
||||
import { Theme } from "@mui/material/styles"
|
||||
import dayjs from "dayjs"
|
||||
import duration from "dayjs/plugin/duration"
|
||||
import minMax from "dayjs/plugin/minMax"
|
||||
import utc from "dayjs/plugin/utc"
|
||||
import semver from "semver"
|
||||
import { PaletteIndex } from "theme/palettes"
|
||||
import * as TypesGen from "../api/typesGenerated"
|
||||
|
||||
dayjs.extend(duration)
|
||||
@@ -27,48 +26,44 @@ const DisplayAgentVersionLanguage = {
|
||||
export const getDisplayWorkspaceBuildStatus = (
|
||||
theme: Theme,
|
||||
build: TypesGen.WorkspaceBuild,
|
||||
): {
|
||||
color: string
|
||||
status: string
|
||||
type: PaletteIndex
|
||||
} => {
|
||||
) => {
|
||||
switch (build.job.status) {
|
||||
case "succeeded":
|
||||
return {
|
||||
type: "success",
|
||||
color: theme.palette.success.main,
|
||||
status: DisplayWorkspaceBuildStatusLanguage.succeeded,
|
||||
}
|
||||
} as const
|
||||
case "pending":
|
||||
return {
|
||||
type: "secondary",
|
||||
color: theme.palette.text.secondary,
|
||||
status: DisplayWorkspaceBuildStatusLanguage.pending,
|
||||
}
|
||||
} as const
|
||||
case "running":
|
||||
return {
|
||||
type: "info",
|
||||
color: theme.palette.primary.main,
|
||||
status: DisplayWorkspaceBuildStatusLanguage.running,
|
||||
}
|
||||
} as const
|
||||
case "failed":
|
||||
return {
|
||||
type: "error",
|
||||
color: theme.palette.text.secondary,
|
||||
status: DisplayWorkspaceBuildStatusLanguage.failed,
|
||||
}
|
||||
} as const
|
||||
case "canceling":
|
||||
return {
|
||||
type: "warning",
|
||||
color: theme.palette.warning.light,
|
||||
status: DisplayWorkspaceBuildStatusLanguage.canceling,
|
||||
}
|
||||
} as const
|
||||
case "canceled":
|
||||
return {
|
||||
type: "secondary",
|
||||
color: theme.palette.text.secondary,
|
||||
status: DisplayWorkspaceBuildStatusLanguage.canceled,
|
||||
}
|
||||
} as const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user