1
- import { Workspace } from "api/typesGenerated" ;
1
+ import type { Workspace } from "api/typesGenerated" ;
2
2
import { Pill } from "components/Pill/Pill" ;
3
- import { FC , PropsWithChildren } from "react" ;
4
- import { makeStyles } from "@mui/styles" ;
5
- import { combineClasses } from "utils/combineClasses" ;
3
+ import { type FC , type PropsWithChildren } from "react" ;
6
4
import { ChooseOne , Cond } from "components/Conditionals/ChooseOne" ;
7
5
import { DormantDeletionText } from "components/WorkspaceDeletion" ;
8
6
import { getDisplayWorkspaceStatus } from "utils/workspace" ;
9
- import Tooltip , { TooltipProps , tooltipClasses } from "@mui/material/Tooltip" ;
7
+ import Tooltip , {
8
+ type TooltipProps ,
9
+ tooltipClasses ,
10
+ } from "@mui/material/Tooltip" ;
10
11
import { styled } from "@mui/material/styles" ;
11
12
import Box from "@mui/material/Box" ;
12
13
import ErrorOutline from "@mui/icons-material/ErrorOutline" ;
14
+ import { type Interpolation , type Theme } from "@emotion/react" ;
13
15
14
16
export type WorkspaceStatusBadgeProps = {
15
17
workspace : Workspace ;
@@ -56,7 +58,6 @@ export const WorkspaceStatusBadge: FC<
56
58
export const WorkspaceStatusText : FC <
57
59
PropsWithChildren < WorkspaceStatusBadgeProps >
58
60
> = ( { workspace, className } ) => {
59
- const styles = useStyles ( ) ;
60
61
const { text, type } = getDisplayWorkspaceStatus (
61
62
workspace . latest_build . status ,
62
63
) ;
@@ -71,11 +72,8 @@ export const WorkspaceStatusText: FC<
71
72
< span
72
73
role = "status"
73
74
data-testid = "build-status"
74
- className = { combineClasses ( [
75
- className ,
76
- styles . root ,
77
- styles [ `type-${ type } ` ] ,
78
- ] ) }
75
+ className = { className }
76
+ css = { [ styles . root , styles [ `type-${ type } ` ] ] }
79
77
>
80
78
{ text }
81
79
</ span >
@@ -95,27 +93,22 @@ const FailureTooltip = styled(({ className, ...props }: TooltipProps) => (
95
93
} ,
96
94
} ) ) ;
97
95
98
- const useStyles = makeStyles ( ( theme ) => ( {
96
+ const styles = {
99
97
root : { fontWeight : 600 } ,
100
- "type-error" : {
98
+
99
+ "type-error" : ( theme ) => ( {
101
100
color : theme . palette . error . light ,
102
- } ,
103
- "type-warning" : {
101
+ } ) ,
102
+ "type-warning" : ( theme ) => ( {
104
103
color : theme . palette . warning . light ,
105
- } ,
106
- "type-success" : {
104
+ } ) ,
105
+ "type-success" : ( theme ) => ( {
107
106
color : theme . palette . success . light ,
108
- } ,
109
- "type-info" : {
107
+ } ) ,
108
+ "type-info" : ( theme ) => ( {
110
109
color : theme . palette . info . light ,
111
- } ,
112
- "type-undefined" : {
110
+ } ) ,
111
+ "type-undefined" : ( theme ) => ( {
113
112
color : theme . palette . text . secondary ,
114
- } ,
115
- "type-primary" : {
116
- color : theme . palette . text . primary ,
117
- } ,
118
- "type-secondary" : {
119
- color : theme . palette . text . secondary ,
120
- } ,
121
- } ) ) ;
113
+ } ) ,
114
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments