import { Button } from '@kit/ui/button';
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
} from '@kit/ui/dialog';
import { Trans } from '@kit/ui/trans';

export default function ConfirmationModal({
  isOpen,
  onClose,
  onConfirm,
  titleKey,
  descriptionKey,
  cancelKey = 'common:cancel',
  confirmKey = 'common:confirm',
}: {
  isOpen: boolean;
  onClose: () => void;
  onConfirm: () => void;
  titleKey: string;
  descriptionKey: string;
  cancelKey?: string;
  confirmKey?: string;
}) {
  return (
    <Dialog open={isOpen} onOpenChange={onClose}>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>
            <Trans i18nKey={titleKey} />
          </DialogTitle>
          <DialogDescription>
            <Trans i18nKey={descriptionKey} />
          </DialogDescription>
        </DialogHeader>
        <DialogFooter className="gap-3">
          <Button variant="outline" onClick={onClose}>
            <Trans i18nKey={cancelKey} />
          </Button>
          <Button onClick={onConfirm}>
            <Trans i18nKey={confirmKey} />
          </Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
