Sha256: de82027ca5dc6f9244391b9a8daea303823917abdcd2d5c8be8422a54f559a92
Contents?: true
Size: 797 Bytes
Versions: 17
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true module Blacklight module Response # Render spellcheck results for a search query class ViewTypeComponent < Blacklight::Component renders_many :views, 'Blacklight::Response::ViewTypeButtonComponent' # @param [Blacklight::Response] response def initialize(response:, search_state:, views: {}, 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? views.many? && !@response.empty? end end end end
Version data entries
17 entries across 17 versions & 2 rubygems