Sha256: c52476faa6b5c7730669bddcdc48bb1347427417ee841911c690dfc191012f21
Contents?: true
Size: 567 Bytes
Versions: 1
Compression:
Stored size: 567 Bytes
Contents
# frozen_string_literal: true module RailsLiveDashboard class JobStatusBadgeComponent < ViewComponent::Base CLASSES = { enqueued: 'bg-orange-50 text-orange-700 ring-orange-700/10', started: 'bg-blue-50 text-blue-700 ring-blue-700/10', performed: 'bg-green-50 text-green-700 ring-green-600/20', discarted: 'bg-red-50 text-red-800 ring-red-600/20' }.freeze def initialize(status) super return if status.nil? @status = status.upcase @classes = CLASSES[status.downcase.to_sym] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_live_dashboard-0.2.0 | app/components/rails_live_dashboard/job_status_badge_component.rb |