'use client'; import React, { useEffect } from 'react'; import { Loader2 } from 'lucide-react'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@/components/ui/alert-dialog'; interface DeleteConfirmationDialogProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; threadName: string; isDeleting: boolean; } /** * Confirmation dialog for deleting a conversation */ export function DeleteConfirmationDialog({ isOpen, onClose, onConfirm, threadName, isDeleting, }: DeleteConfirmationDialogProps) { // Reset pointer events when dialog opens useEffect(() => { if (isOpen) { document.body.style.pointerEvents = 'auto'; } }, [isOpen]); return ( Delete conversation Are you sure you want to delete the conversation{' '} "{threadName}"?
This action cannot be undone.
Cancel { e.preventDefault(); onConfirm(); }} disabled={isDeleting} className="bg-destructive text-white hover:bg-destructive/90" > {isDeleting ? ( <> Deleting... ) : ( 'Delete' )}
); }