# frozen_string_literal: true require "sidekiq/web" require "sidekiq/web/helpers" module Sidekiq module Belt module Community module TopLabel def self.use! Sidekiq::WebActionHelper.change_layout do |content| top_label = (Sidekiq::Belt.config.top_label || {}).fetch(Sidekiq::Belt.env, {}) html = "
 #{::Rack::Utils.escape_html(top_label[:text].to_s)} 
" unless top_label.empty? content.gsub!('
', "#{html}
") end end end end end end end