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 {
13 const initialState = {
19 export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
20 detailsPanelActions.match(action, {
22 LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }),
23 OPEN_DETAILS_PANEL: tabNr => ({ ...state, isOpened: true, tabNr }),
24 TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }),