Skip to content

Commit ffa39ef

Browse files
committed
emotion: WorkspaceBuildLogs
1 parent 6f820c1 commit ffa39ef

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

site/src/components/WorkspaceBuildLogs/WorkspaceBuildLogs.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { makeStyles } from "@mui/styles";
21
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";
54
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
65
import { Logs } from "./Logs";
76
import Box from "@mui/material/Box";
8-
import { combineClasses } from "utils/combineClasses";
7+
import { type Interpolation, type Theme } from "@emotion/react";
98

109
const Language = {
1110
seconds: "seconds",
@@ -53,7 +52,6 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
5352
}) => {
5453
const groupedLogsByStage = groupLogsByStage(logs);
5554
const stages = Object.keys(groupedLogsByStage);
56-
const styles = useStyles();
5755

5856
return (
5957
<Box
@@ -79,15 +77,10 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
7977

8078
return (
8179
<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]}>
8881
<div>{stage}</div>
8982
{shouldDisplayDuration && (
90-
<div className={styles.duration}>
83+
<div css={styles.duration}>
9184
{duration} {Language.seconds}
9285
</div>
9386
)}
@@ -100,8 +93,8 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
10093
);
10194
};
10295

103-
const useStyles = makeStyles((theme) => ({
104-
header: {
96+
const styles = {
97+
header: (theme) => ({
10598
fontSize: 13,
10699
fontWeight: 600,
107100
padding: theme.spacing(0.5, 3),
@@ -119,16 +112,16 @@ const useStyles = makeStyles((theme) => ({
119112
"&:first-child": {
120113
borderRadius: "8px 8px 0 0",
121114
},
122-
},
115+
}),
123116

124117
sticky: {
125118
position: "sticky",
126119
top: 0,
127120
},
128121

129-
duration: {
122+
duration: (theme) => ({
130123
marginLeft: "auto",
131124
color: theme.palette.text.secondary,
132125
fontSize: 12,
133-
},
134-
}));
126+
}),
127+
} satisfies Record<string, Interpolation<Theme>>;

0 commit comments

Comments
 (0)