import {Fragment} from 'react'; import type {PlainRoute, RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import AlertLink from 'sentry/components/alertLink'; import {Button} from 'sentry/components/button'; import ExternalLink from 'sentry/components/links/externalLink'; import Link from 'sentry/components/links/link'; import LinkWithConfirmation from 'sentry/components/links/linkWithConfirmation'; import {PanelTable} from 'sentry/components/panels/panelTable'; import TextCopyInput from 'sentry/components/textCopyInput'; import {IconAdd, IconDelete} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import type {Organization} from 'sentry/types/organization'; import recreateRoute from 'sentry/utils/recreateRoute'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import TextBlock from 'sentry/views/settings/components/text/textBlock'; import type {DeprecatedApiKey} from './types'; type Props = RouteComponentProps<{}, {}> & { /** * Busy differs from loading in that busy is a result of an action like removing */ busy: boolean; keys: DeprecatedApiKey[]; /** * Loading refers to fetching the API Keys */ loading: boolean; onAddApiKey: () => {}; onRemove: (id: DeprecatedApiKey['id']) => {}; organization: Organization; routes: PlainRoute[]; }; function OrganizationApiKeysList({ organization, params, routes, keys, busy, loading, onAddApiKey, onRemove, }: Props) { const hasKeys = Boolean(keys?.length); const action = ( } busy={busy} disabled={busy} onClick={onAddApiKey} > {t('New API Key')} ); return (