24 lines
528 B
Ruby
24 lines
528 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Layouts
|
|
class HorizontalSectionComponent < ViewComponent::Base
|
|
warn_on_deprecated_slot_setter
|
|
|
|
# @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
|