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" ;
3
3
import { Avatar } from "components/Avatar/Avatar" ;
4
4
import { Stack } from "components/Stack/Stack" ;
5
- import { FC } from "react" ;
5
+ import { Interpolation } from "@emotion/react" ;
6
+ import { Theme } from "@emotion/react" ;
6
7
7
8
export interface SelectedTemplateProps {
8
9
template : Template | TemplateExample ;
9
10
}
10
11
11
12
export const SelectedTemplate : FC < SelectedTemplateProps > = ( { template } ) => {
12
- const styles = useStyles ( ) ;
13
-
14
13
return (
15
14
< Stack
16
15
direction = "row"
17
16
spacing = { 3 }
18
- className = { styles . template }
17
+ css = { styles . template }
19
18
alignItems = "center"
20
19
>
21
20
< Avatar
@@ -27,35 +26,33 @@ export const SelectedTemplate: FC<SelectedTemplateProps> = ({ template }) => {
27
26
</ Avatar >
28
27
29
28
< Stack direction = "column" spacing = { 0 } >
30
- < span className = { styles . templateName } >
29
+ < span css = { styles . templateName } >
31
30
{ "display_name" in template && template . display_name . length > 0
32
31
? template . display_name
33
32
: template . name }
34
33
</ span >
35
34
{ template . description && (
36
- < span className = { styles . templateDescription } >
37
- { template . description }
38
- </ span >
35
+ < span css = { styles . templateDescription } > { template . description } </ span >
39
36
) }
40
37
</ Stack >
41
38
</ Stack >
42
39
) ;
43
40
} ;
44
41
45
- const useStyles = makeStyles ( ( theme ) => ( {
46
- template : {
42
+ const styles = {
43
+ template : ( theme ) => ( {
47
44
padding : theme . spacing ( 2.5 , 3 ) ,
48
45
borderRadius : theme . shape . borderRadius ,
49
46
backgroundColor : theme . palette . background . paper ,
50
47
border : `1px solid ${ theme . palette . divider } ` ,
51
- } ,
48
+ } ) ,
52
49
53
50
templateName : {
54
51
fontSize : 16 ,
55
52
} ,
56
53
57
- templateDescription : {
54
+ templateDescription : ( theme ) => ( {
58
55
fontSize : 14 ,
59
56
color : theme . palette . text . secondary ,
60
- } ,
61
- } ) ) ;
57
+ } ) ,
58
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments