%turbo-frame#products-content{ target: "_top", refresh: "morph" }
  .spinner-overlay{ "data-controller": "loading", "data-products-target": "loading", class: "hidden" }
    .spinner-container
      .spinner
      = t('.loading')
  .container
    .sixteen.columns
      = render partial: 'admin/shared/flashes', locals: { flashes: } if defined? flashes
      = render partial: 'filters', locals: { search_term:,
                                              producer_id:,
                                              producer_options:,
                                              category_options:,
                                              category_id: } if display_search_filter
  - if products.any?
    .container.results
      .sixteen.columns
        = render partial: 'sort', locals: { pagy: pagy, search_term: search_term, producer_id: producer_id, category_id: category_id }
        = render partial: 'table', locals: { products:, producer_options:, category_options:, tax_category_options: }
    - if pagy.present? && pagy.pages > 1
      = render partial: 'admin/shared/stimulus_pagination', locals: { pagy: pagy }
  - else
    #no-products
      = render partial: "no_products", locals: { search_term: search_term, producer_id: producer_id, category_id: category_id }
