/* Inline signup. Givebutter owns the fields, validation and confirmation. */
function NewsletterForm() {
  const U = window.U; const data = window.WKYHB;
  const fallback = (
    <div className="wk-newsletter-fallback">
      <p>The signup form isn’t loading right now.</p>
      <a href={U.mailto(data.org.email, 'Newsletter signup request', 'Please add me to the WKYHB chapter newsletter.\n\nName: ')}>
        Request signup by email <U.IconExternal />
      </a>
      <p>You can also email {data.org.email} and ask to join the newsletter.</p>
    </div>
  );
  return (
    <div className="wk-newsletter-form">
      <U.GivebutterWidget lazy widgetId={data.givebutter.signupWidgetId}
        loadingLabel="Loading newsletter signup…" fallback={fallback} />
    </div>
  );
}

window.NewsletterForm = NewsletterForm;
