Files
sure/app/views/shared/_badge.html.erb
soky srm 179552657c Mercury integration (#723)
* Initial mercury impl

* FIX both mercury and generator class

* Finish mercury integration and provider generator

* Fix schema

* Fix linter and tags

* Update routes.rb

* Avoid schema drift

---------

Signed-off-by: soky srm <sokysrm@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2026-01-22 20:37:07 +01:00

23 lines
616 B
Plaintext

<%# locals: (color: nil, pulse: false) %>
<%
def badge_classes(c, p)
classes = case c
when "success"
"bg-green-500/5 text-green-500"
when "error"
"bg-red-500/5 text-red-500"
when "warning"
"bg-orange-500/5 text-orange-500"
else
"bg-gray-500/5 text-secondary"
end
p ? "#{classes} animate-pulse" : classes
end
%>
<span class="inline-flex items-center px-2 py-0.5 rounded-full ring ring-alpha-black-50 text-xs <%= badge_classes(color, pulse) %>">
<%= yield %>
</span>