Class: RailsLiveDashboard::QueryDurationBadgeComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/rails_live_dashboard/query_duration_badge_component.rb

Constant Summary collapse

CLASSES =
{
  ok: 'bg-green-50 text-green-700 ring-green-600/20',
  warning: 'bg-orange-50 text-orange-700 ring-orange-600/10',
  danger: 'bg-red-50 text-red-700 ring-red-600/10'
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(duration) ⇒ QueryDurationBadgeComponent

Returns a new instance of QueryDurationBadgeComponent.



11
12
13
14
15
16
# File 'app/components/rails_live_dashboard/query_duration_badge_component.rb', line 11

def initialize(duration)
  super

  @duration = duration
  @classes = duration_classes
end