@@ -4,6 +4,7 @@ import { Autocomplete, Button, NativeSelect, TextField, Typography } from "@equi
44import ConvertibleTextField from "./ConvertibleTextField.tsx" ;
55import { FORMULA_TO_NAME_MAPPER } from "@/constants/formula_map.tsx" ;
66import { MetaTooltip } from "@/functions/Tooltip.tsx" ;
7+ import { Columns } from "@/components/styles.ts" ;
78
89const DEFAULTS = {
910 O2 : 30 ,
@@ -62,8 +63,8 @@ function ParametersInput({
6263 if ( ! model . parameters ) return ;
6364
6465 return (
65- < div style = { { display : "flex" , flexFlow : "column" , gap : "1.5rem " , paddingTop : "1em" } } >
66- < Typography bold > Input parameters </ Typography >
66+ < div style = { { display : "flex" , flexDirection : "column" , gap : "16px " , flexGrow : 1 } } >
67+ < Typography variant = "h3" > Parameters </ Typography >
6768 { Object . entries ( model . parameters ) . map ( ( [ name , config ] ) =>
6869 config . choices ? (
6970 < NativeSelect
@@ -120,36 +121,43 @@ const ModelInputs: React.FC<{
120121 const invisible = model . validSubstances . filter ( ( subst ) => ! visible . includes ( subst ) ) ;
121122
122123 return (
123- < >
124- < Typography bold > Input concentrations</ Typography >
125- { visible . map ( ( subst , index ) => (
126- < TextField
127- type = "number"
128- key = { index }
129- id = { subst }
130- label = { optionName ( subst ) }
131- style = { { paddingTop : "5px" } }
132- step = "any"
133- unit = "ppm"
134- max = { PPM_MAX }
135- value = { concentrations [ subst ] ?? 0 }
136- onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
137- setConcentrations ( { ...concentrations , [ subst ] : Math . min ( e . target . valueAsNumber , PPM_MAX ) } )
138- }
124+ < div >
125+ < Columns >
126+ < div >
127+ < Typography variant = "h3" > Concentrations</ Typography >
128+ { visible . map ( ( subst , index ) => (
129+ < TextField
130+ type = "number"
131+ key = { index }
132+ id = { subst }
133+ label = { optionName ( subst ) }
134+ style = { { paddingTop : "5px" } }
135+ step = "any"
136+ unit = "ppm"
137+ max = { PPM_MAX }
138+ value = { concentrations [ subst ] ?? 0 }
139+ onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
140+ setConcentrations ( {
141+ ...concentrations ,
142+ [ subst ] : Math . min ( e . target . valueAsNumber , PPM_MAX ) ,
143+ } )
144+ }
145+ />
146+ ) ) }
147+ < SubstanceAdder invisible = { invisible } onAdd = { ( item : string ) => setVisible ( [ ...visible , item ] ) } />
148+ </ div >
149+ < ParametersInput
150+ model = { model }
151+ parameters = { parameters }
152+ setParameter = { ( name : string , value : any ) => {
153+ setParameters ( { ...parameters , [ name ] : value } ) ;
154+ } }
139155 />
140- ) ) }
141- < SubstanceAdder invisible = { invisible } onAdd = { ( item : string ) => setVisible ( [ ...visible , item ] ) } />
142- < ParametersInput
143- model = { model }
144- parameters = { parameters }
145- setParameter = { ( name : string , value : any ) => {
146- setParameters ( { ...parameters , [ name ] : value } ) ;
147- } }
148- />
156+ </ Columns >
149157 < Button style = { { marginTop : "1em" } } onClick = { ( ) => onSubmit ( concentrations , parameters ) } >
150158 Run Simulation
151159 </ Button >
152- </ >
160+ </ div >
153161 ) ;
154162} ;
155163
0 commit comments