1
+ import { type Interpolation , type Theme } from "@emotion/react" ;
1
2
import FormControlLabel from "@mui/material/FormControlLabel" ;
2
3
import Radio from "@mui/material/Radio" ;
3
4
import RadioGroup from "@mui/material/RadioGroup" ;
4
- import { makeStyles } from "@mui/styles" ;
5
5
import TextField from "@mui/material/TextField" ;
6
6
import { Stack } from "components/Stack/Stack" ;
7
- import { FC } from "react" ;
8
- import { TemplateVersionVariable } from "api/typesGenerated" ;
7
+ import { type FC } from "react" ;
8
+ import type { TemplateVersionVariable } from "api/typesGenerated" ;
9
9
10
10
const isBoolean = ( variable : TemplateVersionVariable ) => {
11
11
return variable . type === "bool" ;
12
12
} ;
13
13
14
- const VariableLabel : React . FC < { variable : TemplateVersionVariable } > = ( {
14
+ const VariableLabel : FC < { variable : TemplateVersionVariable } > = ( {
15
15
variable,
16
16
} ) => {
17
- const styles = useStyles ( ) ;
18
-
19
17
return (
20
18
< label htmlFor = { variable . name } >
21
- < span className = { styles . labelName } >
19
+ < span css = { styles . labelName } >
22
20
var.{ variable . name }
23
21
{ ! variable . required && " (optional)" }
24
22
</ span >
25
- < span className = { styles . labelDescription } > { variable . description } </ span >
23
+ < span css = { styles . labelDescription } > { variable . description } </ span >
26
24
</ label >
27
25
) ;
28
26
} ;
@@ -40,12 +38,10 @@ export const VariableInput: FC<VariableInputProps> = ({
40
38
variable,
41
39
defaultValue,
42
40
} ) => {
43
- const styles = useStyles ( ) ;
44
-
45
41
return (
46
42
< Stack direction = "column" spacing = { 0.75 } >
47
43
< VariableLabel variable = { variable } />
48
- < div className = { styles . input } >
44
+ < div css = { styles . input } >
49
45
< VariableField
50
46
disabled = { disabled }
51
47
onChange = { onChange }
@@ -113,26 +109,21 @@ const VariableField: React.FC<VariableInputProps> = ({
113
109
) ;
114
110
} ;
115
111
116
- const useStyles = makeStyles ( ( theme ) => ( {
117
- labelName : {
112
+ const styles = {
113
+ labelName : ( theme ) => ( {
118
114
fontSize : 14 ,
119
115
color : theme . palette . text . secondary ,
120
116
display : "block" ,
121
117
marginBottom : theme . spacing ( 0.5 ) ,
122
- } ,
123
- labelDescription : {
118
+ } ) ,
119
+ labelDescription : ( theme ) => ( {
124
120
fontSize : 16 ,
125
121
color : theme . palette . text . primary ,
126
122
display : "block" ,
127
123
fontWeight : 600 ,
128
- } ,
124
+ } ) ,
129
125
input : {
130
126
display : "flex" ,
131
127
flexDirection : "column" ,
132
128
} ,
133
- checkbox : {
134
- display : "flex" ,
135
- alignItems : "center" ,
136
- gap : theme . spacing ( 1 ) ,
137
- } ,
138
- } ) ) ;
129
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments