9cda32793b45ff11b342a111f851f3bdb0373448
[arvados-workbench2.git] / src / views-components / context-menu / item-sets / project-item-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuItemGroup } from "../../../components/context-menu/context-menu";
6 import { ContextMenuItemSet } from "../context-menu-item-set";
7 import actions from "../../../store/project/project-action";
8 import { IconTypes } from "../../../components/icon/icon";
9
10 export const projectItemSet: ContextMenuItemSet = {
11     getItems: () => items,
12     handleItem: (dispatch, item, resource) => {
13         if (item.name === "New project") {
14             dispatch(actions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
15         }
16     }
17 };
18
19 const items: ContextMenuItemGroup[] = [[{
20     icon: IconTypes.FOLDER,
21     name: "New project"
22 }, {
23     icon: IconTypes.ANNOUNCEMENT,
24     name: "Share"
25 }]];