Sha256: 30c0659332be5ced5ee945fef7b18d0beded234ecbf37e1f1f4deaa2ab57ed37

Contents?: true

Size: 685 Bytes

Versions: 104

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

class Avo::EmptyStateComponent < ViewComponent::Base
  def initialize(message: nil, resource_name: nil, related_name: nil, view_type: :table, add_background: false)
    @message = message
    @view_type = view_type
    @related_name = related_name
    @resource_name = resource_name
    @add_background = add_background
  end

  def message
    return @message if @message.present?

    translation_tag = @related_name.present? ? 'avo.no_related_item_found' : 'avo.no_item_found'
    helpers.t translation_tag, item: @resource_name
  end

  def view_type_svg
    return "grid-empty-state" if @view_type.to_sym == :grid

    "table-empty-state"
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
avo-2.21.1.pre.pr1476 app/components/avo/empty_state_component.rb
avo-2.21.1.pre.issue1450 app/components/avo/empty_state_component.rb
avo-2.21.1.pre.issue1444 app/components/avo/empty_state_component.rb
avo-2.20.0 app/components/avo/empty_state_component.rb
avo-2.19.0 app/components/avo/empty_state_component.rb
avo-2.18.1 app/components/avo/empty_state_component.rb
avo-2.18.1.pre.1.eagerloaddirs app/components/avo/empty_state_component.rb
avo-2.18.0 app/components/avo/empty_state_component.rb
avo-2.17.1.pre.5.stackedlayout app/components/avo/empty_state_component.rb
avo-2.17.1.pre.4.issue.1342 app/components/avo/empty_state_component.rb
avo-2.17.1.pre.3 app/components/avo/empty_state_component.rb
avo-2.17.1.pre.2.customauthorizationclients app/components/avo/empty_state_component.rb
avo-2.17.1.pre.1.zeitwerk.eager.load.dir app/components/avo/empty_state_component.rb
avo-2.17.0 app/components/avo/empty_state_component.rb
avo-2.16.1.pre.1.nativefields app/components/avo/empty_state_component.rb
avo-2.16.0 app/components/avo/empty_state_component.rb
avo-2.15.3 app/components/avo/empty_state_component.rb
avo-2.15.3.pre.1.data.attrs.to.sidebar.items app/components/avo/empty_state_component.rb
avo-2.15.2 app/components/avo/empty_state_component.rb
avo-2.15.2.pre.1 app/components/avo/empty_state_component.rb