import { ToggleTrashAction } from "views-components/context-menu/actions/trash-action";
import { toggleProjectTrashed } from "store/trash/trash-actions";
import { copyToClipboardAction } from "store/open-in-new-tab/open-in-new-tab.actions";
+import { ToggleFavoriteAction } from "views-components/context-menu/actions/favorite-action";
+import { toggleFavorite } from "store/favorites/favorites-actions";
+import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
+
+export const msToggleFavoriteAction = {
+ component: ToggleFavoriteAction,
+ name: "ToggleFavoriteAction",
+ execute: (dispatch, resources) => {
+ dispatch(toggleFavorite(resources[0])).then(() => {
+ dispatch(favoritePanelActions.REQUEST_ITEMS());
+ });
+ },
+};
export const msCopyToClipboardMenuAction = {
icon: Link,
},
};
-export const msProjectActionSet: ContextMenuActionSet = [[msCopyToClipboardMenuAction, msMoveToAction, msToggleTrashAction]];
+export const msProjectActionSet: ContextMenuActionSet = [[msCopyToClipboardMenuAction, msMoveToAction, msToggleTrashAction, msToggleFavoriteAction]];