export interface DetailsPanelState {
resourceUuid: string;
isOpened: boolean;
+ tabNr: number;
}
const initialState = {
resourceUuid: '',
- isOpened: false
+ isOpened: false,
+ tabNr: 0
};
export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
detailsPanelActions.match(action, {
default: () => state,
LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }),
- OPEN_DETAILS_PANEL: resourceUuid => ({ resourceUuid, isOpened: true }),
+ OPEN_DETAILS_PANEL: tabNr => ({ ...state, isOpened: true, tabNr }),
TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }),
});