"use client";

// "Set this now" affordance on a doc page. Dispatches the global event that the
// smart-search component listens for, opening the inline value modal.

export default function HelpSetButton({ actionId, label }) {
  return (
    <button
      type="button"
      className="help-article-set"
      onClick={() => window.dispatchEvent(new CustomEvent('madarx:open-setting', { detail: { id: actionId } }))}
    >
      {label || 'Set this now'}
    </button>
  );
}
