Sha256: 60eace543d1af71919451792523c9a4142b47f3078bd43049d4024d5e1fce8ba
Contents?: true
Size: 1.01 KB
Versions: 14
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module Blacklight module Response # Render spellcheck results for a search query class ViewTypeButtonComponent < ViewComponent::Base with_collection_parameter :view # @param [Blacklight::Configuration::View] view def initialize(view:, key: nil, selected: false, search_state: nil, classes: 'btn btn-outline-secondary btn-icon') @view = view @key = key || view.key @selected = selected @classes = classes @search_state = search_state end def icon Deprecation.silence(Blacklight::CatalogHelperBehavior) do @view_context.render_view_type_group_icon(@view.icon || @key) end end def label Deprecation.silence(Blacklight::ConfigurationHelperBehavior) do @view_context.view_label(@key) end end def url @view_context.url_for(@search_state.to_h.merge(view: @key)) end def selected? @selected end end end end
Version data entries
14 entries across 14 versions & 1 rubygems