// redux/slices/loopChartTypeSlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

interface LoopChartTypeState {
  chartTitle: string;
}

const initialState: LoopChartTypeState = {
  chartTitle: "Isolationsmessung", // Standardwert
};

const loopChartTypeSlice = createSlice({
  name: "loopChartType",
  initialState,
  reducers: {
    setChartTitle: (state, action: PayloadAction<string>) => {
      state.chartTitle = action.payload;
    },
  },
});

export const { setChartTitle } = loopChartTypeSlice.actions;
export default loopChartTypeSlice.reducer;
