mirror of
https://github.com/outline/outline.git
synced 2026-11-22 05:51:43 +03:00
23 lines
630 B
TypeScript
23 lines
630 B
TypeScript
import { useMemo } from "react";
|
|
import { ActionSeparator } from "~/actions";
|
|
import {
|
|
changeGroupUserPermission,
|
|
removeGroupUser,
|
|
} from "~/actions/definitions/groupUsers";
|
|
import { useMenuAction } from "~/hooks/useMenuAction";
|
|
|
|
/**
|
|
* Hook that constructs the action menu for a member of a group. The group and
|
|
* user are read from the active models in the action context.
|
|
*
|
|
* @returns action with children for use in menus.
|
|
*/
|
|
export function useGroupUserMenuActions() {
|
|
const actions = useMemo(
|
|
() => [changeGroupUserPermission, ActionSeparator, removeGroupUser],
|
|
[]
|
|
);
|
|
|
|
return useMenuAction(actions);
|
|
}
|