Sha256: ad5490ec34045d3dd22e78f179b5ebb00684d1634a0a5be4eaf1d3cd8a2f6923
Contents?: true
Size: 879 Bytes
Versions: 8
Compression:
Stored size: 879 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| with_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
8 entries across 8 versions & 2 rubygems