diff --git a/src/client/components/monitor/MonitorInfo.tsx b/src/client/components/monitor/MonitorInfo.tsx index 1174406..56fbabe 100644 --- a/src/client/components/monitor/MonitorInfo.tsx +++ b/src/client/components/monitor/MonitorInfo.tsx @@ -94,14 +94,24 @@ export const MonitorInfo: React.FC = React.memo((props) => { }); const handleDelete = useEvent(async () => { - await deleteMutation.mutateAsync({ - workspaceId, - monitorId, + Modal.confirm({ + title: 'Warning', + content: 'Did you sure delete this monitor?', + okButtonProps: { + danger: true, + }, + onOk: async () => { + await deleteMutation.mutateAsync({ + workspaceId, + monitorId, + }); + await trpcUtils.monitor.all.refetch(); + + navigate('/monitor', { + replace: true, + }); + }, }); - - trpcUtils.monitor.all.refetch(); - - navigate('/monitor'); }); const handleClearEvents = useEvent(() => { @@ -205,13 +215,6 @@ export const MonitorInfo: React.FC = React.memo((props) => { )} - - - - = React.memo((props) => { label: 'Show Badge', onClick: () => setShowBadge(true), }, + { + type: 'divider', + }, + { + key: 'delete', + label: 'Delete', + danger: true, + onClick: handleDelete, + }, ], }} >