"use client";

import { Button } from "@/components/ui/button";
import {
  Dialog,
  DialogContent,
  DialogHeader,
  DialogTitle,
  DialogFooter,
} from "@/components/ui/dialog";

interface ImapDeleteDialogProps {
  deleteConfirm: number | null;
  onCancel: () => void;
  onConfirm: (id: number) => void;
}

export function ImapDeleteDialog({
  deleteConfirm,
  onCancel,
  onConfirm,
}: ImapDeleteDialogProps) {
  return (
    <Dialog open={deleteConfirm !== null} onOpenChange={onCancel}>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Konto loeschen?</DialogTitle>
        </DialogHeader>
        <p className="text-sm text-muted-foreground">
          Soll dieses IMAP-Konto wirklich entfernt werden? Bereits importierte
          E-Mails bleiben im Archiv erhalten.
        </p>
        <DialogFooter>
          <Button variant="outline" onClick={onCancel}>
            Abbrechen
          </Button>
          <Button
            variant="destructive"
            onClick={() => deleteConfirm !== null && onConfirm(deleteConfirm)}
          >
            Loeschen
          </Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
