mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +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>
25 lines
658 B
TypeScript
25 lines
658 B
TypeScript
import { useMemo } from "react";
|
|
import {
|
|
copyApiKeyActionFactory,
|
|
revokeApiKeyActionFactory,
|
|
} from "~/actions/definitions/apiKeys";
|
|
import type ApiKey from "~/models/ApiKey";
|
|
import { useMenuAction } from "~/hooks/useMenuAction";
|
|
|
|
/**
|
|
* Hook that constructs the action menu for API key operations.
|
|
*
|
|
* @param apiKey - the API key to build actions for.
|
|
* @returns action with children for use in menus.
|
|
*/
|
|
export function useApiKeyMenuActions(apiKey: ApiKey) {
|
|
const actions = useMemo(
|
|
() => [
|
|
copyApiKeyActionFactory({ apiKey }),
|
|
revokeApiKeyActionFactory({ apiKey }),
|
|
],
|
|
[apiKey]
|
|
);
|
|
return useMenuAction(actions);
|
|
}
|