Files
nanobot/webui/src/components/DeleteConfirm.tsx
T

47 lines
1.2 KiB
TypeScript
Raw Normal View History

import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
interface DeleteConfirmProps {
open: boolean;
title: string;
onCancel: () => void;
onConfirm: () => void;
}
export function DeleteConfirm({
open,
title,
onCancel,
onConfirm,
}: DeleteConfirmProps) {
return (
<AlertDialog open={open} onOpenChange={(o) => (!o ? onCancel() : undefined)}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete {title}?</AlertDialogTitle>
<AlertDialogDescription>
The session file will be removed from disk. This cannot be undone.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel onClick={onCancel}>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={onConfirm}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
>
Delete
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
}