This eliminates redundant code in the 3 views, creating frozen hashes to store the colors for each type. Update the tailwind config to read the helpers/web.rb file, to ensure tailwind will pick up the css classes used in the hash constants. After changes (rebased on main since last commit, so totals have changed): Line Coverage: 99.59% (11687 / 11735) Branch Coverage: 97.59% (3075 / 3151)
9 lines
289 B
Plaintext
9 lines
289 B
Plaintext
<%# locals: (state:, color:, extra_class: nil) %>
|
|
|
|
<span
|
|
class="inline-flex items-baseline rounded-full px-2 text-xs font-semibold leading-5 <%= color %> <%= extra_class %>"
|
|
>
|
|
<%== render("components/icon", locals: { name: "dot", classes: "mr-1.5 h-2 w-2" }) %>
|
|
<%= state %>
|
|
</span>
|