mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 14:54:49 +00:00
22 lines
615 B
Plaintext
22 lines
615 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> |