"use client";

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

interface SettingsSuccessDialogProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  title: string;
  description?: string;
  closeLabel: string;
}

export function SettingsSuccessDialog({
  open,
  onOpenChange,
  title,
  description,
  closeLabel,
}: SettingsSuccessDialogProps) {
  return (
    <Dialog open={open} onOpenChange={onOpenChange}>
      <DialogContent className="max-w-[520px] rounded-2xl p-8">
        <DialogHeader className="space-y-3 text-center">
          <DialogTitle className="text-2xl font-bold text-foreground">
            {title}
          </DialogTitle>
          {description ? (
            <DialogDescription className="text-sm leading-6 text-muted-foreground">
              {description}
            </DialogDescription>
          ) : null}
        </DialogHeader>
        <DialogFooter className="justify-center sm:justify-center">
          <Button
            type="button"
            className="h-11 min-w-[180px] rounded-xl"
            onClick={() => onOpenChange(false)}
          >
            {closeLabel}
          </Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
