psu-libraries/psulib_blacklight

View on GitHub
app/components/browse/navigator.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module Browse
  class Navigator < ViewComponent::Base
    attr_reader :list

    def initialize(list:)
      @list = list
    end

    def next_title
      'View next page of results'
    end

    def previous_title
      'View previous page of results'
    end

    def previous?
      page > 1
    end

    def next?
      !list.last_page?
    end
  end
end