Class: JetUi::Pagy::Component
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- JetUi::Pagy::Component
- Defined in:
- app/components/jet_ui/pagy/component.rb
Constant Summary collapse
- WRAPPER_CLASSES =
'flex flex-col md:items-center gap-x-6 gap-y-2 md:justify-between md:flex-row'
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(pagy:, **options) ⇒ Component
constructor
A new instance of Component.
- #render? ⇒ Boolean
Constructor Details
#initialize(pagy:, **options) ⇒ Component
Returns a new instance of Component.
8 9 10 11 |
# File 'app/components/jet_ui/pagy/component.rb', line 8 def initialize(pagy:, **) @pagy = pagy @options = end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 |
# File 'app/components/jet_ui/pagy/component.rb', line 17 def call content_tag :div, class: class_names(WRAPPER_CLASSES, @options.delete(:class)), **@options do safe_join([page_info, nav_wrapper]) end end |
#render? ⇒ Boolean
13 14 15 |
# File 'app/components/jet_ui/pagy/component.rb', line 13 def render? @pagy.pages > 1 end |