CEC-5436: add configure component (#491)

* CEC-5436: add configure component

* fix deps

* linter

* remove console log

* remove logging
This commit is contained in:
Tristan Timblin
2023-12-12 12:03:10 -08:00
committed by GitHub
parent 858edca5f5
commit ec7607e733
5 changed files with 339 additions and 106 deletions

View File

@@ -1,10 +1,11 @@
import { FormControl, InputLabel, Select } from "@material-ui/core";
export const DropDownList = ({data, label, value, labelField, valueField, onChange, classes, ...others}) => {
export const DropDownList = ({ data, label, value, labelField, valueField, onChange, classes, fullWidth, ...others }) => {
return (
<FormControl
variant="outlined"
margin="normal"
fullWidth={fullWidth}
>
<InputLabel className={classes.whiteBackground}>
{label}
@@ -16,9 +17,9 @@ export const DropDownList = ({data, label, value, labelField, valueField, onChan
onChange={onChange}
{...others}
>
{data && data.map((item, index) => (
<option key={index} value={item[valueField || "value"]}>{item[labelField || "label"]}</option>
))}
{data && data.map((item, index) => (
<option key={index} value={item[valueField || "value"]}>{item[labelField || "label"]}</option>
))}
</Select>
</FormControl>
);