2023-07-03 23:17:43 +03:00
|
|
|
import { Accessor, Component, Setter } from "solid-js";
|
|
|
|
|
|
|
|
|
|
import { aggregateGranularity } from "../consts";
|
|
|
|
|
|
|
|
|
|
export const SelectGranularity: Component<{
|
|
|
|
|
getGranularity: Accessor<string>,
|
|
|
|
|
setGranularity: Setter<string>,
|
|
|
|
|
}> = ({ getGranularity, setGranularity }) => {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
2023-07-04 00:20:13 +03:00
|
|
|
<h4>Select granularity</h4>
|
2023-07-03 23:17:43 +03:00
|
|
|
<select onChange={(e) => setGranularity(e.target.value)}>
|
|
|
|
|
{ aggregateGranularity.map(granularity =>
|
|
|
|
|
<option
|
|
|
|
|
value={granularity}
|
|
|
|
|
selected={granularity === getGranularity() ? true : false}
|
|
|
|
|
>{granularity}</option>
|
|
|
|
|
)}
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|