// brushSlice.ts (✅ Korrekt) import { createSlice } from "@reduxjs/toolkit"; const brushSlice = createSlice({ name: "brush", initialState: { startIndex: 0, endIndex: 0, startDate: null, endDate: null, }, reducers: { setBrushRange(state, action) { state.startIndex = action.payload.startIndex; state.endIndex = action.payload.endIndex; state.startDate = action.payload.startDate || state.startDate; state.endDate = action.payload.endDate || state.endDate; }, }, }); export const { setBrushRange } = brushSlice.actions; export default brushSlice.reducer;