ubicloud/views/components/progress_bar.erb
Jeremy Evans 750ebdc055 Change from erb_formatter to herb/formatter
Currently, herb/formatter has at least 4 bugs the prevent us from
switching to it (https://github.com/marcoroth/herb/issues 476, 477,
478, and 479). This includes manual fixes for each issue.

herb/formatter also introduces a rubocop violation for the
Layout/AssignmentIndentation cop. This disables that cop.
2025-09-05 14:01:01 -07:00

13 lines
561 B
Text

<%# locals: (numerator:, denominator:, title:) %>
<% progress = [100, denominator.zero? ? 100 : 100 * numerator / denominator].min
color = (progress < 60) ? "bg-blue-500" : (progress < 80) ? "bg-yellow-500" : "bg-red-500" %>
<div class="flex justify-between mb-1">
<span class="text-base font-medium"><%= title %></span>
<span class="text-sm font-medium"><%= numerator %>/<%= denominator %> (<%= progress %>%)</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-3">
<div class="<%= color %> h-3 rounded-full w-[<%= progress %>%]"></div>
</div>