Files
outline/app/menus/ApiKeyMenu.tsx
T
Tom Moor 69e8aac4f1 Move "Api Keys" listing to filterable table (#12117)
* Move 'Api Keys' listing to filterable table

* Add context menu
Allow copying new keys
2026-04-19 18:12:32 -04:00

25 lines
730 B
TypeScript

import { observer } from "mobx-react";
import { useTranslation } from "react-i18next";
import type ApiKey from "~/models/ApiKey";
import { DropdownMenu } from "~/components/Menu/DropdownMenu";
import { OverflowMenuButton } from "~/components/Menu/OverflowMenuButton";
import { useApiKeyMenuActions } from "~/hooks/useApiKeyMenuActions";
type Props = {
/** The apiKey to associate with the menu */
apiKey: ApiKey;
};
function ApiKeyMenu({ apiKey }: Props) {
const { t } = useTranslation();
const rootAction = useApiKeyMenuActions(apiKey);
return (
<DropdownMenu action={rootAction} align="end" ariaLabel={t("API key")}>
<OverflowMenuButton />
</DropdownMenu>
);
}
export default observer(ApiKeyMenu);