Skip to content

Commit 739245f

Browse files
committed
emotion: SelectedTemplate
1 parent f3e471c commit 739245f

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
import { makeStyles } from "@mui/styles";
2-
import { Template, TemplateExample } from "api/typesGenerated";
1+
import { type FC } from "react";
2+
import type { Template, TemplateExample } from "api/typesGenerated";
33
import { Avatar } from "components/Avatar/Avatar";
44
import { Stack } from "components/Stack/Stack";
5-
import { FC } from "react";
5+
import { Interpolation } from "@emotion/react";
6+
import { Theme } from "@emotion/react";
67

78
export interface SelectedTemplateProps {
89
template: Template | TemplateExample;
910
}
1011

1112
export const SelectedTemplate: FC<SelectedTemplateProps> = ({ template }) => {
12-
const styles = useStyles();
13-
1413
return (
1514
<Stack
1615
direction="row"
1716
spacing={3}
18-
className={styles.template}
17+
css={styles.template}
1918
alignItems="center"
2019
>
2120
<Avatar
@@ -27,35 +26,33 @@ export const SelectedTemplate: FC<SelectedTemplateProps> = ({ template }) => {
2726
</Avatar>
2827

2928
<Stack direction="column" spacing={0}>
30-
<span className={styles.templateName}>
29+
<span css={styles.templateName}>
3130
{"display_name" in template && template.display_name.length > 0
3231
? template.display_name
3332
: template.name}
3433
</span>
3534
{template.description && (
36-
<span className={styles.templateDescription}>
37-
{template.description}
38-
</span>
35+
<span css={styles.templateDescription}>{template.description}</span>
3936
)}
4037
</Stack>
4138
</Stack>
4239
);
4340
};
4441

45-
const useStyles = makeStyles((theme) => ({
46-
template: {
42+
const styles = {
43+
template: (theme) => ({
4744
padding: theme.spacing(2.5, 3),
4845
borderRadius: theme.shape.borderRadius,
4946
backgroundColor: theme.palette.background.paper,
5047
border: `1px solid ${theme.palette.divider}`,
51-
},
48+
}),
5249

5350
templateName: {
5451
fontSize: 16,
5552
},
5653

57-
templateDescription: {
54+
templateDescription: (theme) => ({
5855
fontSize: 14,
5956
color: theme.palette.text.secondary,
60-
},
61-
}));
57+
}),
58+
} satisfies Record<string, Interpolation<Theme>>;

0 commit comments

Comments
 (0)