"use client" import { useState } from "react" import { cn } from "@lib/utils" import { dmSans125ClassName, dmSansClassName } from "@/lib/fonts" import { Loader2, XIcon } from "lucide-react" import { Button } from "@ui/components/button" import * as DialogPrimitive from "@radix-ui/react-dialog" import { Dialog, DialogContent, DialogTitle, DialogDescription, } from "@repo/ui/components/dialog" const PROVIDER_LABELS: Record = { "google-drive": "Google Drive", notion: "Notion", onedrive: "OneDrive", gmail: "Gmail", github: "GitHub", "web-crawler": "Web Crawler", s3: "S3", } interface RemoveConnectionDialogProps { open: boolean onOpenChange: (open: boolean) => void providerName?: string provider?: string documentCount?: number onConfirm: (deleteDocuments: boolean) => void isDeleting: boolean } export function RemoveConnectionDialog({ open, onOpenChange, providerName, provider, documentCount = 0, onConfirm, isDeleting, }: RemoveConnectionDialogProps) { const [action, setAction] = useState<"keep" | "delete">("keep") const displayName = providerName || (provider ? PROVIDER_LABELS[provider] : "this connection") const handleConfirm = () => { onConfirm(action === "delete") } return ( { if (!isDeleting) { onOpenChange(o) if (!o) setAction("keep") } }} >
Remove connection What would you like to do with the{" "} {documentCount > 0 ? ( <> {documentCount} {" "} memories from{" "} ) : ( <>memories from )} {displayName} ?
Close
) }