debian-mirror-gitlab/app/components/layouts/horizontal_section_component.rb
2023-07-09 08:55:56 +05:30

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