Class: Avo::EmptyStateComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/avo/empty_state_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, view_type: :table, add_background: false, by_association: false) ⇒ EmptyStateComponent

Returns a new instance of EmptyStateComponent.



6
7
8
9
10
11
# File 'app/components/avo/empty_state_component.rb', line 6

def initialize(message: nil, view_type: :table, add_background: false, by_association: false)
  @message = message
  @view_type = view_type
  @add_background = add_background
  @by_association = by_association
end

Instance Attribute Details

#add_backgroundObject (readonly)

Returns the value of attribute add_background.



4
5
6
# File 'app/components/avo/empty_state_component.rb', line 4

def add_background
  @add_background
end

#by_associationObject (readonly)

Returns the value of attribute by_association.



4
5
6
# File 'app/components/avo/empty_state_component.rb', line 4

def by_association
  @by_association
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'app/components/avo/empty_state_component.rb', line 4

def message
  @message
end

#view_typeObject (readonly)

Returns the value of attribute view_type.



4
5
6
# File 'app/components/avo/empty_state_component.rb', line 4

def view_type
  @view_type
end

Instance Method Details

#textObject



13
14
15
# File 'app/components/avo/empty_state_component.rb', line 13

def text
  message || locale_message
end

#view_type_svgObject



17
18
19
# File 'app/components/avo/empty_state_component.rb', line 17

def view_type_svg
  "#{view_type}-empty-state"
end