1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action";
6 import { CollectionResource } from "~/models/collection";
8 export interface CollectionPanelState {
9 item: CollectionResource | null;
10 loadBigCollections: boolean;
13 const initialState = {
15 loadBigCollections: false,
18 export const collectionPanelReducer = (state: CollectionPanelState = initialState, action: CollectionPanelAction) =>
19 collectionPanelActions.match(action, {
21 SET_COLLECTION: (item) => ({
24 loadBigCollections: false,
26 LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }),
27 LOAD_BIG_COLLECTIONS: (loadBigCollections) => ({ ...state, loadBigCollections}),