mirror of
https://github.com/outline/outline.git
synced 2026-11-27 16:08:58 +03:00
* Move 'Api Keys' listing to filterable table * Add context menu Allow copying new keys
25 lines
730 B
TypeScript
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);
|