feat: Charttitel in ChartSwitcher dynamisch an Slot-Typ angepasst via loopChartTypeSlice

- Neues Redux Slice erstellt zur Verwaltung des Titels
- Dropdown-Auswahl in LoopChartActionBar aktualisiert Redux-Wert
- ChartSwitcher verwendet dynamischen Titel statt statischem Text
This commit is contained in:
ISA
2025-04-02 07:38:48 +02:00
parent 60eba4aa01
commit 76f4b92fb5
5 changed files with 42 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import {
setChartOpen,
} from "../../../../../../redux/slices/kabelueberwachungChartSlice";
import { setBrushRange } from "../../../../../../redux/slices/brushSlice";
import { setChartTitle } from "../../../../../../redux/slices/loopChartTypeSlice";
const LoopChartActionBar: React.FC = () => {
const dispatch = useDispatch();
@@ -154,13 +155,19 @@ const LoopChartActionBar: React.FC = () => {
<select
value={selectedSlotType}
onChange={(e) =>
onChange={(e) => {
const value = e.target.value as
| "isolationswiderstand"
| "schleifenwiderstand";
dispatch(setSelectedSlotType(value));
dispatch(
setSelectedSlotType(
e.target.value as "isolationswiderstand" | "schleifenwiderstand"
setChartTitle(
value === "isolationswiderstand"
? "Isolationsmessung"
: "Schleifenmessung"
)
)
}
);
}}
className="px-3 py-1 bg-white border rounded text-sm"
>
<option value="schleifenwiderstand">Schleifenwiderstand</option>