1
- import { makeStyles } from "@mui/styles" ;
2
1
import dayjs from "dayjs" ;
3
- import { ComponentProps , FC , Fragment } from "react" ;
4
- import { ProvisionerJobLog } from "api/typesGenerated" ;
2
+ import { type ComponentProps , type FC , Fragment } from "react" ;
3
+ import type { ProvisionerJobLog } from "api/typesGenerated" ;
5
4
import { MONOSPACE_FONT_FAMILY } from "theme/constants" ;
6
5
import { Logs } from "./Logs" ;
7
6
import Box from "@mui/material/Box" ;
8
- import { combineClasses } from "utils/combineClasses " ;
7
+ import { type Interpolation , type Theme } from "@emotion/react " ;
9
8
10
9
const Language = {
11
10
seconds : "seconds" ,
@@ -53,7 +52,6 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
53
52
} ) => {
54
53
const groupedLogsByStage = groupLogsByStage ( logs ) ;
55
54
const stages = Object . keys ( groupedLogsByStage ) ;
56
- const styles = useStyles ( ) ;
57
55
58
56
return (
59
57
< Box
@@ -79,15 +77,10 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
79
77
80
78
return (
81
79
< Fragment key = { stage } >
82
- < div
83
- className = { combineClasses ( [
84
- styles . header ,
85
- sticky ? styles . sticky : "" ,
86
- ] ) }
87
- >
80
+ < div css = { [ styles . header , sticky && styles . sticky ] } >
88
81
< div > { stage } </ div >
89
82
{ shouldDisplayDuration && (
90
- < div className = { styles . duration } >
83
+ < div css = { styles . duration } >
91
84
{ duration } { Language . seconds }
92
85
</ div >
93
86
) }
@@ -100,8 +93,8 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
100
93
) ;
101
94
} ;
102
95
103
- const useStyles = makeStyles ( ( theme ) => ( {
104
- header : {
96
+ const styles = {
97
+ header : ( theme ) => ( {
105
98
fontSize : 13 ,
106
99
fontWeight : 600 ,
107
100
padding : theme . spacing ( 0.5 , 3 ) ,
@@ -119,16 +112,16 @@ const useStyles = makeStyles((theme) => ({
119
112
"&:first-child" : {
120
113
borderRadius : "8px 8px 0 0" ,
121
114
} ,
122
- } ,
115
+ } ) ,
123
116
124
117
sticky : {
125
118
position : "sticky" ,
126
119
top : 0 ,
127
120
} ,
128
121
129
- duration : {
122
+ duration : ( theme ) => ( {
130
123
marginLeft : "auto" ,
131
124
color : theme . palette . text . secondary ,
132
125
fontSize : 12 ,
133
- } ,
134
- } ) ) ;
126
+ } ) ,
127
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments