import { Controller } from '@hotwired/stimulus';

export default class extends Controller<HTMLDivElement> {
   initialize() {
      const element = this.element.querySelector('button[name="cSubmit"]') as HTMLButtonElement;

      element.onclick = function() {
         element.classList.add('is-submitting');
      }

      this.element.addEventListener('button:loading:disable', function() {
         element.classList.remove('is-submitting');
      });
   }
}
