Select city on canvas

This commit is contained in:
Guntis Smaukstelis
2024-01-06 23:48:23 +02:00
parent cb3e525fc2
commit d6707b7bb0
6 changed files with 82 additions and 32 deletions
+19
View File
@@ -0,0 +1,19 @@
import { Accessor, Component, Setter } from "solid-js";
import { weatherField } from "../consts";
export const SelectField: Component<{
getField: Accessor<string>,
setField: Setter<string>,
}> = (props) => {
return (
<select onChange={(e) => props.setField(e.target.value)}>
{ weatherField.map(field =>
<option
value={field}
selected={field === props.getField() ? true : false}
>{field}</option>
)}
</select>
);
}