212f416b88568f6b846331e0e930065bb868fb25
[arvados-workbench2.git] / src / store / multiselect / multiselect-reducer.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { multiselectActions } from './multiselect-actions';
6
7 type MultiselectToolbarState = {
8     isVisible: boolean;
9 };
10
11 const multiselectToolbarInitialState = {
12     isVisible: false,
13 };
14
15 export const multiselectReducer = (state: MultiselectToolbarState = multiselectToolbarInitialState, action) => {
16     if (action.type === multiselectActions.TOGGLE_VISIBLITY) return { ...state, isVisible: action.payload };
17     return state;
18 };