Add typescript paths to top level folders
[arvados-workbench2.git] / src / store / details-panel / details-panel-reducer.ts
index 73fc604d93dd8f5ebd366db56e0f7e65115b26a3..adc31e4bd6f60f55eff6e6f45ea6cae0ac6b275f 100644 (file)
@@ -2,8 +2,8 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { Resource } from "../../common/api/common-resource-service";
-import actions, { DetailsPanelAction } from "./details-panel-action";
+import { detailsPanelActions, DetailsPanelAction } from "./details-panel-action";
+import { Resource } from "~/models/resource";
 
 export interface DetailsPanelState {
     item: Resource | null;
@@ -15,12 +15,10 @@ const initialState = {
     isOpened: false
 };
 
-const reducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
-    actions.match(action, {
+export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
+    detailsPanelActions.match(action, {
         default: () => state,
         LOAD_DETAILS: () => state,
         LOAD_DETAILS_SUCCESS: ({ item }) => ({ ...state, item }),
         TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened })
     });
-
-export default reducer;