Files
CPLv4.0/redux/slices/brushSlice.ts
Ismail Ali e0379c24a6 feat(ui): Slot-Nummer nach links verschoben und Datumsauswahl horizontal ausgerichtet
- Slot-Nr.-Anzeige nach links im ActionBar verschoben.
- Datum-Labels („Von“ & „Bis“) und Eingabefelder horizontal ausgerichtet.
- Verbesserte UI/UX der Chart-Steuerungskomponenten.
2025-03-14 21:30:21 +01:00

40 lines
913 B
TypeScript

// brushSlice.ts
import { createSlice } from "@reduxjs/toolkit";
interface BrushState {
startIndex: number;
endIndex: number;
startDate: string | null;
endDate: string | null;
}
const initialState: BrushState = {
startIndex: 0,
endIndex: 0,
startDate: null,
endDate: null,
};
const brushSlice = createSlice({
name: "brush",
initialState,
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;
},
resetBrushRange(state) {
state.startIndex = 0;
state.endIndex = 0;
state.startDate = null;
state.endDate = null;
},
},
});
export const { setBrushRange, resetBrushRange } = brushSlice.actions;
export default brushSlice.reducer;