You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
698 B
27 lines
698 B
import React from 'react';
|
|
import { DeleteDashboardModal } from './DeleteDashboardModal';
|
|
import { Button, ModalsController } from '@grafana/ui';
|
|
import { DashboardModel } from '../../state';
|
|
|
|
type Props = {
|
|
dashboard: DashboardModel;
|
|
};
|
|
|
|
export const DeleteDashboardButton = ({ dashboard }: Props) => (
|
|
<ModalsController>
|
|
{({ showModal, hideModal }) => (
|
|
<Button
|
|
variant="destructive"
|
|
onClick={() => {
|
|
showModal(DeleteDashboardModal, {
|
|
dashboard,
|
|
hideModal,
|
|
});
|
|
}}
|
|
aria-label="Dashboard settings page delete dashboard button"
|
|
>
|
|
Delete Dashboard
|
|
</Button>
|
|
)}
|
|
</ModalsController>
|
|
);
|
|
|