mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* chore: Audit and move inline actions to definitions * fix: Reuse existing smart-quote translation key in emoji delete dialog Co-Authored-By: Claude <noreply@anthropic.com> * Remove two usages of 'Link copied' translation --------- Co-authored-by: Claude <noreply@anthropic.com>
27 lines
778 B
TypeScript
27 lines
778 B
TypeScript
import { useMemo } from "react";
|
|
import type WebhookSubscription from "~/models/WebhookSubscription";
|
|
import { useMenuAction } from "~/hooks/useMenuAction";
|
|
import {
|
|
deleteWebhookSubscriptionActionFactory,
|
|
editWebhookSubscriptionActionFactory,
|
|
} from "../actions";
|
|
|
|
/**
|
|
* Hook that constructs the action menu for webhook subscription operations.
|
|
*
|
|
* @param webhook - the webhook subscription to build actions for.
|
|
* @returns action with children for use in menus.
|
|
*/
|
|
export function useWebhookSubscriptionMenuActions(
|
|
webhook: WebhookSubscription
|
|
) {
|
|
const actions = useMemo(
|
|
() => [
|
|
editWebhookSubscriptionActionFactory({ webhook }),
|
|
deleteWebhookSubscriptionActionFactory({ webhook }),
|
|
],
|
|
[webhook]
|
|
);
|
|
return useMenuAction(actions);
|
|
}
|