"use client";

export function ConfirmButton({
  confirmText,
  label,
  variant = "err",
}: {
  confirmText: string;
  label: string;
  variant?: "err" | "warn" | "muted" | "ok";
}) {
  return (
    <button
      type="submit"
      className={`badge ${variant}`}
      style={{ border: "none", cursor: "pointer" }}
      onClick={(e) => {
        if (!confirm(confirmText)) e.preventDefault();
      }}
    >
      {label}
    </button>
  );
}
