* implement delete user conversation on agent * format * implement delete session endpoint * implement delete session on persistence services * added deletion of sessions and added fetch sessions with query instead of with useEffect * removed unused texts * implemented dropdown menu on conversations
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import { AlertTriangle } from "lucide-react";
|
|
import { Button } from "@/components/ui/button";
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from "@/components/ui/dialog";
|
|
|
|
interface DeleteSessionModalProps {
|
|
isOpen: boolean;
|
|
onClose: () => void;
|
|
onConfirm: () => void;
|
|
sessionTitle: string;
|
|
isDeleting?: boolean;
|
|
}
|
|
|
|
export function DeleteSessionModal({
|
|
isOpen,
|
|
onClose,
|
|
onConfirm,
|
|
sessionTitle,
|
|
isDeleting = false,
|
|
}: DeleteSessionModalProps) {
|
|
return (
|
|
<Dialog open={isOpen} onOpenChange={onClose}>
|
|
<DialogContent>
|
|
<DialogHeader>
|
|
<DialogTitle className="flex items-center gap-2">
|
|
<AlertTriangle className="h-5 w-5 text-destructive" />
|
|
Delete Conversation
|
|
</DialogTitle>
|
|
<DialogDescription>
|
|
Are you sure you want to delete "{sessionTitle}"? This
|
|
action cannot be undone and will permanently remove the conversation
|
|
and all its messages.
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
<DialogFooter>
|
|
<Button variant="outline" onClick={onClose} disabled={isDeleting}>
|
|
Cancel
|
|
</Button>
|
|
<Button
|
|
variant="destructive"
|
|
onClick={onConfirm}
|
|
disabled={isDeleting}
|
|
>
|
|
{isDeleting ? "Deleting..." : "Delete"}
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|