- content_for :page_title do
  = t('.listing_orders')

- content_for :minimal_js, true

- content_for :page_actions do
  %li
    = button_link_to t('.new_order'), spree.new_admin_order_url, icon: 'icon-plus', id: 'admin_new_order'

= render partial: 'spree/admin/shared/order_sub_menu'

- content_for :table_filter_title do
  = t(:search)

- content_for :table_filter do
  = render partial: 'filters'

#orders-index{"data-controller": "search checked"}
  = render partial: "table", locals: { pagy: @pagy, orders: @orders }

= render 'spree/admin/shared/custom-confirm'

= render ConfirmModalComponent.new(id: "resend_confirmation", confirm_actions: "click->bulk-actions#perform", controller: "bulk-actions", reflex: "Admin::Orders#resend_confirmation_emails") do
  .margin-bottom-30
    = t('.resend_confirmation_confirm_html')

= render ConfirmModalComponent.new(id: "send_invoice", confirm_actions: "click->bulk-actions#perform", controller: "bulk-actions", reflex: "Admin::Orders#send_invoices") do
  .margin-bottom-30
    = t('.send_invoice_confirm_html')

= render ConfirmModalComponent.new(id: "cancel_orders", confirm_actions: "click->bulk-actions#perform", controller: "bulk-actions", reflex: "Admin::Orders#cancel_orders", message: "spree/admin/orders/messages/cancel_orders") do
  .margin-bottom-30
    = t("js.admin.orders.cancel_the_order_html")
