|
|
@@ -16,6 +16,17 @@ import {
|
|
|
DropdownMenuItem,
|
|
|
DropdownMenuTrigger,
|
|
|
} from '@/components/ui/dropdown-menu.js';
|
|
|
+import {
|
|
|
+ AlertDialog,
|
|
|
+ AlertDialogAction,
|
|
|
+ AlertDialogCancel,
|
|
|
+ AlertDialogContent,
|
|
|
+ AlertDialogDescription,
|
|
|
+ AlertDialogFooter,
|
|
|
+ AlertDialogHeader,
|
|
|
+ AlertDialogTitle,
|
|
|
+ AlertDialogTrigger,
|
|
|
+} from '@/components/ui/alert-dialog.js';
|
|
|
import { DisplayComponent } from '@/framework/component-registry/dynamic-component.js';
|
|
|
import { ResultOf } from '@/graphql/graphql.js';
|
|
|
import { Trans, useLingui } from '@/lib/trans.js';
|
|
|
@@ -523,12 +534,37 @@ function DeleteMutationRowAction({
|
|
|
},
|
|
|
});
|
|
|
return (
|
|
|
- <DropdownMenuItem onClick={() => deleteMutationFn({ id: row.original.id })}>
|
|
|
- <div className="flex items-center gap-2 text-destructive">
|
|
|
- <TrashIcon className="w-4 h-4 text-destructive" />
|
|
|
- <Trans>Delete</Trans>
|
|
|
- </div>
|
|
|
- </DropdownMenuItem>
|
|
|
+ <AlertDialog>
|
|
|
+ <AlertDialogTrigger asChild>
|
|
|
+ <DropdownMenuItem onSelect={(e) => e.preventDefault()}>
|
|
|
+ <div className="flex items-center gap-2 text-destructive">
|
|
|
+ <TrashIcon className="w-4 h-4 text-destructive" />
|
|
|
+ <Trans>Delete</Trans>
|
|
|
+ </div>
|
|
|
+ </DropdownMenuItem>
|
|
|
+ </AlertDialogTrigger>
|
|
|
+ <AlertDialogContent>
|
|
|
+ <AlertDialogHeader>
|
|
|
+ <AlertDialogTitle>
|
|
|
+ <Trans>Confirm deletion</Trans>
|
|
|
+ </AlertDialogTitle>
|
|
|
+ <AlertDialogDescription>
|
|
|
+ <Trans>Are you sure you want to delete this item? This action cannot be undone.</Trans>
|
|
|
+ </AlertDialogDescription>
|
|
|
+ </AlertDialogHeader>
|
|
|
+ <AlertDialogFooter>
|
|
|
+ <AlertDialogCancel>
|
|
|
+ <Trans>Cancel</Trans>
|
|
|
+ </AlertDialogCancel>
|
|
|
+ <AlertDialogAction
|
|
|
+ onClick={() => deleteMutationFn({ id: row.original.id })}
|
|
|
+ className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
|
|
+ >
|
|
|
+ <Trans>Delete</Trans>
|
|
|
+ </AlertDialogAction>
|
|
|
+ </AlertDialogFooter>
|
|
|
+ </AlertDialogContent>
|
|
|
+ </AlertDialog>
|
|
|
);
|
|
|
}
|
|
|
/**
|