import form_styles from "./Form.module.css"; import Button from "./Button"; import { validate } from "./Form"; const DictInputRow = (props) => { const dict = { ...props.value }; if (!props.disableKeys) { dict[""] = "0"; } let unit = ""; if (props.unit) { unit = ({props.unit}); } let tooltip = ""; if (props.tooltip !== undefined) { tooltip = ; } const onChangeValue = (key, v) => { const newDict = { ...dict }; newDict[key] = v; props.onChange(newDict); }; const onChangeKey = (prevKey, newKey) => { const newDict = renameKey(dict, prevKey, newKey); if (!("" in newDict)) newDict[""] = ""; props.onChange(newDict); }; const form = []; Object.keys(dict).forEach((key, index) => { let label = ( {props.label} {unit} ); if (index > 0) { label = ""; } let isValid = true; if (props.validate !== undefined) { isValid = validate(props.validate, dict[key]); } let className = ""; if (!isValid) className = form_styles.invalid; form.push(