1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { linkAccountPanelActions, LinkAccountPanelAction } from "~/store/link-account-panel/link-account-panel-actions";
6 import { UserResource, User } from "~/models/user";
8 export interface LinkAccountPanelState {
9 user: UserResource | undefined;
10 userToLink: UserResource | undefined;
13 const initialState = {
18 export const linkAccountPanelReducer = (state: LinkAccountPanelState = initialState, action: LinkAccountPanelAction) =>
19 linkAccountPanelActions.match(action, {
21 LOAD_LINKING: ({ userToLink, user }) => ({ ...state, user, userToLink }),
22 REMOVE_LINKING: () => ({ ...state, user: undefined, userToLink: undefined })