Sha256: f49567404f41be65c0ecf84fa8961c609d07f3073cb12d10515ab8f0a4efb6f5
Contents?: true
Size: 874 Bytes
Versions: 18
Compression:
Stored size: 874 Bytes
Contents
# frozen_string_literal: true module Blacklight module Response # Render spellcheck results for a search query class ViewTypeComponent < ViewComponent::Base renders_many :views, 'Blacklight::Response::ViewTypeButtonComponent' # @param [Blacklight::Response] response def initialize(response:, views: {}, search_state:, selected: nil) @response = response @views = views @search_state = search_state @selected = selected end def before_render return if views.any? @views.each do |key, config| view(key: key, view: config, selected: @selected == key, search_state: @search_state) end end def render? Deprecation.silence(Blacklight::ConfigurationHelperBehavior) do helpers.has_alternative_views? end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems