Files
outline/app/hooks/useApiKeyMenuActions.ts
Tom MoorandClaude 8192bc0514 chore: Audit and move inline actions to definitions (#13133)
* 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>
2026-07-25 16:13:12 +00:00

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);
}