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.13.3.pre.3 app/components/avo/empty_state_component.rb
avo-2.13.3.pre.2 app/components/avo/empty_state_component.rb
avo-2.13.3.pre.1 app/components/avo/empty_state_component.rb
avo-2.13.2.pre.2 app/components/avo/empty_state_component.rb
avo-2.13.2.pre.1 app/components/avo/empty_state_component.rb
avo-2.13.1 app/components/avo/empty_state_component.rb
avo-2.13.0 app/components/avo/empty_state_component.rb
avo-2.12.1.pre.1 app/components/avo/empty_state_component.rb
avo-2.12.0 app/components/avo/empty_state_component.rb
avo-2.11.3.pre.3 app/components/avo/empty_state_component.rb
avo-2.11.3.pre.2 app/components/avo/empty_state_component.rb
avo-2.11.3.pre.1 app/components/avo/empty_state_component.rb
avo-2.11.2.pre.3 app/components/avo/empty_state_component.rb
avo-2.11.2.pre.2 app/components/avo/empty_state_component.rb
avo-2.11.2.pre.1 app/components/avo/empty_state_component.rb
avo-2.11.1.pre.3 app/components/avo/empty_state_component.rb
avo-2.11.1 app/components/avo/empty_state_component.rb
avo-2.11.1.pre.2 app/components/avo/empty_state_component.rb
avo-2.11.1.pre.1 app/components/avo/empty_state_component.rb
avo-2.11.0 app/components/avo/empty_state_component.rb