change code after CR
[arvados-workbench2.git] / src / store / run-process-panel / run-process-panel-reducer.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { RunProcessPanelAction, runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions';
6
7 interface RunProcessPanel {
8     currentStep: number;
9 }
10
11 const initialState: RunProcessPanel = {
12     currentStep: 0
13 };
14
15 export const runProcessPanelReducer = (state = initialState, action: RunProcessPanelAction): RunProcessPanel =>
16     runProcessPanelActions.match(action, {
17         SET_CURRENT_STEP: currentStep => ({ ...state, currentStep }),
18         default: () => state
19     });