1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { detailsPanelActions, DetailsPanelAction } from "./details-panel-action";
7 export interface DetailsPanelState {
11 isTransitioning: boolean;
14 const initialState = {
18 isTransitioning: false
21 export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
22 detailsPanelActions.match(action, {
24 LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }),
25 OPEN_DETAILS_PANEL: tabNr => ({ ...state, isOpened: true, tabNr }),
26 TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }),
27 START_TRANSITION: () => ({...state, isTransitioning: true}),
28 END_TRANSITION: () => ({...state, isTransitioning: false})