Sha256: 8a39e39e097cecf499d71938e383a866edfb162ebba2f711925ca98822be2dc7

Contents?: true

Size: 479 Bytes

Versions: 1

Compression:

Stored size: 479 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module Response
    class SpellcheckComponent < ViewComponent::Base
      def initialize(response:, options: nil)
        @response = response
        @options = options || @response&.spelling&.words
      end

      def link_to_query(query)
        @view_context.link_to_query(query)
      end

      def render?
        @options.any? && @view_context.should_show_spellcheck_suggestions?(@response)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-7.11.1 app/components/blacklight/response/spellcheck_component.rb