Add options

This commit is contained in:
Florian Schroedl
2024-01-23 17:30:03 +01:00
parent 7adfb2d4ad
commit a3a6d6a3e9

View File

@@ -0,0 +1,34 @@
import React, { useState, useEffect } from "react";
import { Input } from "@/components/ui/input";
import { path } from "ramda";
import { ForecastDatePicker } from "@/components/ui/DatePicker";
export const Options = function ({ state, updateState }) {
return (
<div
className="flex flex-col p-5 bg-white border border-solid border-slate-300 rounded-lg space-y-5 w-full h-full"
style={{ maxWidth: "810px", maxHeight: "470px" }}
>
<h1 className="text-lg font-medium mb-1">Options</h1>
<label className="font-medium">
Chart line width:
<Input
type="number"
defaultValue="1"
min="1"
value={path(["options", "lineWidth"], state)}
onChange={(e) =>
updateState({ options: { lineWidth: e.target.value } })
}
/>
</label>
<label>
<ForecastDatePicker
onChange={(dateTime) =>
updateState({ options: { defaultDate: dateTime } })
}
/>
</label>
</div>
);
};