Sha256: 4273994fe470a865d7b39f8be0aa8593cb1b8286220d02df82d8f39a261e2e7d
Contents?: true
Size: 758 Bytes
Versions: 23
Compression:
Stored size: 758 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, description: nil, body_classes: nil, data: {}, display_breadcrumbs: false, index: nil) @title = title @description = description @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 def description return @description if @description.present? ' ' end end
Version data entries
23 entries across 23 versions & 1 rubygems