diff options
Diffstat (limited to 'app/components/layouts/horizontal_section_component.rb')
-rw-r--r-- | app/components/layouts/horizontal_section_component.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/components/layouts/horizontal_section_component.rb b/app/components/layouts/horizontal_section_component.rb new file mode 100644 index 00000000000..48c960f17d9 --- /dev/null +++ b/app/components/layouts/horizontal_section_component.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Layouts + class HorizontalSectionComponent < ViewComponent::Base + # @param [Boolean] border + # @param [Hash] options + def initialize(border: true, options: {}) + @border = border + @options = options + end + + private + + renders_one :title + renders_one :description + renders_one :body + + def formatted_options + @options.merge({ class: [('gl-border-b' if @border), @options[:class]].flatten.compact }) + end + end +end |