Sha256: 444a27e3dc34efb74d6c7945de0acba94c8d75c0095b6e081ef4b517ee08c6e8

Contents?: true

Size: 621 Bytes

Versions: 10

Compression:

Stored size: 621 Bytes

Contents

# frozen_string_literal: true

class Avo::PanelComponent < ViewComponent::Base
  renders_one :tools
  renders_one :body
  renders_one :bare_content
  renders_one :footer

  def initialize(title: nil, body_classes: nil, data: {}, display_breadcrumbs: false, index: nil)
    @title = title
    @body_classes = body_classes
    @data = data
    @display_breadcrumbs = display_breadcrumbs
    @index = index
  end

  private

  def data_attributes
    @data.merge({'panel-index': @index}).map do |key, value|
      " data-#{key}=\"#{value}\""
    end.join
  end

  def display_breadcrumbs?
    @display_breadcrumbs
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
avo-1.19.1.pre.9 app/components/avo/panel_component.rb
avo-1.19.1.pre.8 app/components/avo/panel_component.rb
avo-1.19.1.pre.7 app/components/avo/panel_component.rb
avo-1.19.1.pre.6 app/components/avo/panel_component.rb
avo-1.19.1.pre.5 app/components/avo/panel_component.rb
avo-1.19.1.pre.4 app/components/avo/panel_component.rb
avo-1.19.1.pre.3 app/components/avo/panel_component.rb
avo-1.19.1.pre.2 app/components/avo/panel_component.rb
avo-1.19.1.pre.1 app/components/avo/panel_component.rb
avo-1.19.0 app/components/avo/panel_component.rb