window.addEventListener('load', function() {
    $('.btn-remove').on('click', function(e) {
      e.preventDefault();
  
      const itemId = $(this).data('id');
      const countryName = $(this).data('country-name');
  
      $modal = $('#remove-geofence-area-country-modal');
      $modal.find('h4.modal-title').text(`Removing country: ${countryName}`);
      $modal.find('#removeBtn').data('id', itemId);
    });
  
    $('#removeBtn').on('click', function(e) {
      e.preventDefault();
      const itemId = $(this).data('id');
      window.__api__.remove(`/geofence_area_country/${itemId}/delete`, itemId);
    })
  });