import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "../ui/alert-dialog"; type DiscardChangesDialogProps = { description: string; onKeepEditing: () => void; onDiscard: () => void; }; // The admin-v2 dirty-close choice. Render it only while asking: a reopened Radix dialog can // re-append its overlay after content still leaving, which puts the overlay over its own buttons. const DiscardChangesDialog = ({ description, onKeepEditing, onDiscard }: DiscardChangesDialogProps) => ( !open && onKeepEditing()}> Discard unsaved changes? {description} Keep editing ); export default DiscardChangesDialog;