@inherits ViewModelTemplate<PageViewModel>
@using Dynamicweb.Frontend
@using Dynamicweb.Rendering

@{
    var addressId = Dynamicweb.Context.Current?.Request.QueryString.Get("AddressId");
    var addressName = Dynamicweb.Context.Current?.Request.QueryString.Get("AddressName");
}

<div class="modal fade" id="deleteAddresstModal_@(addressId)" tabindex="-1" aria-labelledby="DeleteAddress" aria-hidden="true" 
  hx-on::load="bootstrap.Modal.getOrCreateInstance(this).show();"
  x-on:hidden-bs-modal.dot="
    bootstrap.Modal.getOrCreateInstance($event.target).dispose();
    $event.target.remove();
  "
  >
  <div class="modal-dialog pt-8">
    <form method="post" class="modal-content">
        <input type="hidden" name="AddressId" value="@(addressId)" />
        <div class="modal-body">
            <button type="button" class="btn-close position-absolute end-0 pe-4" data-bs-dismiss="modal" aria-label="@Translate("Cancel")"></button>
            <h2 class="mb-2 h5">@Translate("Delete address")</h2>
            <p class="mb-0 text-body text-opacity-50 lh-sm fs-7">@Translate("Are you sure you want to delete the address") <span class="fw-bold text-body">@(addressName) (@(addressId))</span></p>
        </div>
        <div class="modal-footer border-0">
            <button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal" data-dw-button>@Translate("Cancel")</button>
            <button type="submit" class="btn btn-primary btn-sm" name="Cmd" value="DeleteAddress" data-dw-button>@Translate("Delete address")</button>
        </div>
    </form>
  </div>
</div>