import { css } from '@emotion/css';
import React, { useState } from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { Alert, Button, ConfirmModal, useStyles2 } from '@grafana/ui';
interface Props {
onMigrate: () => void;
apikeysCount: number;
disabled?: boolean;
}
export const MigrateToServiceAccountsCard = ({ onMigrate, apikeysCount, disabled }: Props): JSX.Element => {
const [isModalOpen, setIsModalOpen] = useState(false);
const styles = useStyles2(getStyles);
const docsLink = (
Find out more about the migration here.
);
const migrationBoxDesc = (
Are you sure you want to migrate all API keys to service accounts? {docsLink}
This hides the API keys tab.
);
return (
<>
{apikeysCount > 0 && (
We will soon deprecate API keys. Each API key will be migrated into a service account with a token and will
continue to work as they were. We encourage you to migrate your API keys to service accounts now. {docsLink}