Refactor select fields

This commit is contained in:
Guntis Smaukstelis
2023-06-22 19:39:49 +03:00
parent bb817e5171
commit 4d93fe68dc
5 changed files with 59 additions and 57 deletions
+25
View File
@@ -0,0 +1,25 @@
import { Accessor, Component, Setter } from "solid-js";
import { aggregateKey } from "../consts";
export const SelectKey: Component<{
getKey: Accessor<string>,
setKey: Setter<string>,
}> = (props) => {
return (
<div>
<h3>Select key</h3>
<ul>
{ aggregateKey.map(key =>
<label><li><input
type="checkbox"
name="aggregateKey"
value={key}
checked={key === props.getKey() ? true : false}
onClick={() => props.setKey(key)}
/>{key}</li></label>
)}
</ul>
</div>
);
}