Class: StompBase::Dashboard::SystemOverviewCardComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/stomp_base/dashboard/system_overview_card_component.rb

Instance Method Summary collapse

Methods inherited from BaseComponent

#call, #render?

Constructor Details

#initialize(system_info:) ⇒ SystemOverviewCardComponent

Returns a new instance of SystemOverviewCardComponent.



6
7
8
9
# File 'app/components/stomp_base/dashboard/system_overview_card_component.rb', line 6

def initialize(system_info:)
  super()
  @system_info = system_info
end

Instance Method Details

#environment_badge_colorObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/components/stomp_base/dashboard/system_overview_card_component.rb', line 11

def environment_badge_color
  case system_info[:environment]
  when "production"
    "bg-red-100 text-red-800 border-red-200"
  when "staging"
    "bg-yellow-100 text-yellow-800 border-yellow-200"
  when "development"
    "bg-green-100 text-green-800 border-green-200"
  else
    "bg-gray-100 text-gray-800 border-gray-200"
  end
end