import React from 'react'; import { css } from '@emotion/css'; import { Alert, Field, Modal, useStyles2 } from '@grafana/ui'; import { GrafanaThemeV2 } from '@grafana/data'; export interface Props { onDismiss: () => void; apiKey: string; rootPath: string; } export function ApiKeysAddedModal({ onDismiss, apiKey, rootPath }: Props): JSX.Element { const styles = useStyles2(getStyles); return ( {apiKey} It is not stored in this form, so be sure to copy it now.

You can authenticate a request using the Authorization HTTP header, example:

        curl -H "Authorization: Bearer {apiKey}" {rootPath}/api/dashboards/home
      
); } function getStyles(theme: GrafanaThemeV2) { return { label: css` padding: ${theme.spacing(1)}; background-color: ${theme.colors.background.secondary}; border-radius: ${theme.shape.borderRadius()}; `, small: css` font-size: ${theme.typography.bodySmall.fontSize}; font-weight: ${theme.typography.bodySmall.fontWeight}; `, }; }