mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 01:00:33 +08:00

* i18n: everything should target @grafana/i18n * wip * chore: updates after PR feedback * Trigger build * Trigger build * Trigger build * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: revert all flaky tests * chore: some incorrect usages of useTranslate
30 lines
894 B
TypeScript
30 lines
894 B
TypeScript
import { selectors } from '@grafana/e2e-selectors';
|
|
import { Trans } from '@grafana/i18n';
|
|
import { Button, ModalsController } from '@grafana/ui';
|
|
|
|
import { getDashboardSrv } from '../../services/DashboardSrv';
|
|
|
|
import { DeleteDashboardModal } from './DeleteDashboardModal';
|
|
|
|
export const DeleteDashboardButton = () => {
|
|
const dashboard = getDashboardSrv().getCurrent()!;
|
|
return (
|
|
<ModalsController>
|
|
{({ showModal, hideModal }) => (
|
|
<Button
|
|
variant="destructive"
|
|
onClick={() => {
|
|
showModal(DeleteDashboardModal, {
|
|
dashboard,
|
|
hideModal,
|
|
});
|
|
}}
|
|
data-testid={selectors.pages.Dashboard.Settings.General.deleteDashBoard}
|
|
>
|
|
<Trans i18nKey="dashboard-settings.dashboard-delete-button">Delete dashboard</Trans>
|
|
</Button>
|
|
)}
|
|
</ModalsController>
|
|
);
|
|
};
|