Sha256: fc8fc38b6ecfdaeebab1247580366eadc40a567e44c21e4602b2db0d83f849fb

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module Response
    # Render a pagination widget for search results
    class PaginationComponent < ::ViewComponent::Base
      # @param [Blacklight::Response] response
      # @param [Hash] html html options for the pagination container
      def initialize(response:, html: {}, **pagination_args)
        @response = response
        @html_attr = { aria: { label: t('views.pagination.aria.container_label') } }.merge(html)
        @pagination_args = { outer_window: 2, theme: 'blacklight' }.merge(pagination_args)
      end

      def pagination
        helpers.paginate @response, **@pagination_args
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-7.23.0.1 app/components/blacklight/response/pagination_component.rb
blacklight-7.23.0 app/components/blacklight/response/pagination_component.rb