Class: Www::BlogFaqSectionComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::BlogFaqSectionComponent
- Defined in:
- app/components/www/blog_faq_section_component.rb
Overview
Section wrapper for blog FAQs rendered via the faq % liquid tag.
Displays a section with title, icon, and list of FAQ cards.
Constant Summary collapse
- DEFAULT_TITLE =
'Frequently Asked Questions'- DEFAULT_ICON =
'circle-question'
Instance Method Summary collapse
-
#initialize(article_faqs:, section_title: nil, preview_mode: false) ⇒ BlogFaqSectionComponent
constructor
A new instance of BlogFaqSectionComponent.
- #render? ⇒ Boolean
Methods inherited from ApplicationComponent
#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags
Constructor Details
#initialize(article_faqs:, section_title: nil, preview_mode: false) ⇒ BlogFaqSectionComponent
Returns a new instance of BlogFaqSectionComponent.
12 13 14 15 16 17 |
# File 'app/components/www/blog_faq_section_component.rb', line 12 def initialize(article_faqs:, section_title: nil, preview_mode: false) super() @article_faqs = Array(article_faqs).compact @section_title = section_title.presence || DEFAULT_TITLE @preview_mode = preview_mode end |
Instance Method Details
#render? ⇒ Boolean
19 20 21 |
# File 'app/components/www/blog_faq_section_component.rb', line 19 def render? @article_faqs.present? end |