1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Resource } from "../../common/api/common-resource-service";
6 import actions, { DetailsPanelAction } from "./details-panel-action";
8 export interface DetailsPanelState {
13 const initialState = {
18 const reducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
19 actions.match(action, {
21 LOAD_DETAILS: () => state,
22 LOAD_DETAILS_SUCCESS: ({ item }) => ({ ...state, item }),
23 TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened })
26 export default reducer;