1import React from 'react'; 2import { DeleteDashboardModal } from './DeleteDashboardModal'; 3import { Button, ModalsController } from '@grafana/ui'; 4import { DashboardModel } from '../../state'; 5 6type Props = { 7 dashboard: DashboardModel; 8}; 9 10export const DeleteDashboardButton = ({ dashboard }: Props) => ( 11 <ModalsController> 12 {({ showModal, hideModal }) => ( 13 <Button 14 variant="destructive" 15 onClick={() => { 16 showModal(DeleteDashboardModal, { 17 dashboard, 18 hideModal, 19 }); 20 }} 21 aria-label="Dashboard settings page delete dashboard button" 22 > 23 Delete Dashboard 24 </Button> 25 )} 26 </ModalsController> 27); 28