index.tsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import {Button} from 'sentry/components/button';
  2. import EmptyMessage from 'sentry/components/emptyMessage';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {Panel, PanelBody, PanelHeader} from 'sentry/components/panels';
  5. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  6. import {t, tct} from 'sentry/locale';
  7. import {Organization} from 'sentry/types';
  8. import withOrganization from 'sentry/utils/withOrganization';
  9. import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
  10. import TextBlock from 'sentry/views/settings/components/text/textBlock';
  11. export function OrganizationAuthTokensIndex({
  12. organization,
  13. }: {
  14. organization: Organization;
  15. }) {
  16. const isEmpty = true;
  17. const tokenList = [];
  18. const createNewToken = (
  19. <Button
  20. priority="primary"
  21. size="sm"
  22. to={`/settings/${organization.slug}/auth-tokens/new-token/`}
  23. data-test-id="create-token"
  24. >
  25. {t('Create New Token')}
  26. </Button>
  27. );
  28. return (
  29. <div>
  30. <SentryDocumentTitle title={t('Auth Tokens')} />
  31. <SettingsPageHeader title={t('Auth Tokens')} action={createNewToken} />
  32. <TextBlock>
  33. {t(
  34. "Authentication tokens allow you to perform actions against the Sentry API on behalf of your organization. They're the easiest way to get started using the API."
  35. )}
  36. </TextBlock>
  37. <TextBlock>
  38. {tct(
  39. 'For more information on how to use the web API, see our [link:documentation].',
  40. {
  41. link: <ExternalLink href="https://docs.sentry.io/api/" />,
  42. }
  43. )}
  44. </TextBlock>
  45. <Panel>
  46. <PanelHeader>{t('Auth Token')}</PanelHeader>
  47. <PanelBody>
  48. {isEmpty && (
  49. <EmptyMessage>
  50. {t("You haven't created any authentication tokens yet.")}
  51. </EmptyMessage>
  52. )}
  53. {tokenList?.map(token => (
  54. <div key={token}>{token}</div>
  55. ))}
  56. </PanelBody>
  57. </Panel>
  58. </div>
  59. );
  60. }
  61. export default withOrganization(OrganizationAuthTokensIndex);