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 {
12 const initialState = {
17 export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
18 detailsPanelActions.match(action, {
20 LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }),
21 OPEN_DETAILS_PANEL: resourceUuid => ({ resourceUuid, isOpened: true }),
22 TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }),