[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2022-09-22 11:02:27 +00:00
parent 0a1811e86c
commit f9b3ff58f9

View File

@@ -2,9 +2,7 @@ import React, { useState, useEffect } from "react";
import "./table-select.css";
import PropTypes from "prop-types";
const DynamicTable = (props) => {
var [message, setMessage] = useState(""),
[message2, setMessage2] = useState("");
var { current_propobject } = props;
@@ -15,12 +13,11 @@ const DynamicTable = (props) => {
var [propvalues, setOwnValues] = useState(Object.values(current_propobject));
var updateMessageKey = (event) => {
setMessage(event.target.value);
}
};
var updateMessageValue = (event) => {
setMessage2(event.target.value);
}
};
const handleRefresh = () => {
var propobject = {};
propkeys.forEach((key, i) => (propobject[key] = propvalues[i]));
props.setProp(propobject);
@@ -28,8 +25,7 @@ const DynamicTable = (props) => {
props.setPropValues(propvalues);
setMessage("");
setMessage2("");
}
};
const handleClick = () => {
if (message != "") {
@@ -54,8 +50,7 @@ const DynamicTable = (props) => {
console.log(propkeys);
console.log(propvalues);
console.log(propobject);
}
};
const renderKeyRows = () => {
return propkeys.map(function (o, i) {
@@ -76,7 +71,7 @@ const DynamicTable = (props) => {
}
setOwnKeys(propkeys);
props.setPropKeys(propkeys);
props.setProp(propobject)
props.setProp(propobject);
handleRefresh();
}}
/>
@@ -84,9 +79,8 @@ const DynamicTable = (props) => {
</tr>
);
});
}
};
const renderValueRows = () => {
return propvalues.map(function (o, i) {
//console.log("ValRows" +i)
//console.log("ValRows" +o)
@@ -108,9 +102,8 @@ const DynamicTable = (props) => {
</tr>
);
});
}
};
const renderDelete = () => {
return propvalues.map(function (o, i) {
return (
<tr key={"item-" + i}>
@@ -136,9 +129,7 @@ const DynamicTable = (props) => {
</tr>
);
});
}
};
return (
<div>
@@ -191,7 +182,7 @@ const DynamicTable = (props) => {
<hr />
</div>
);
}
};
DynamicTable.propTypes = {
current_keys: PropTypes.array,
current_values: PropTypes.array,