2025-04-28 13:57:32 -05:00
|
|
|
<%# locals: { trend:, comparison_label: nil } %>
|
2024-10-07 16:20:36 -04:00
|
|
|
|
2025-02-21 11:57:59 -05:00
|
|
|
<p class="text-sm" style="color: <%= trend.color %>">
|
2024-04-22 06:30:42 -06:00
|
|
|
<% if trend.direction.flat? %>
|
2025-04-28 13:57:32 -05:00
|
|
|
<%= t(".no_change") %><%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
|
2024-03-06 09:56:59 -05:00
|
|
|
<% else %>
|
2025-02-25 17:28:40 -05:00
|
|
|
<span class="font-mono">
|
2025-02-21 11:57:59 -05:00
|
|
|
<%= trend.value.is_a?(Money) ? format_money(trend.value) : trend.value.round(2) %>
|
|
|
|
</span>
|
2024-10-07 16:20:36 -04:00
|
|
|
<% unless trend.percent.infinite? %>
|
2025-04-30 18:14:22 -04:00
|
|
|
<span class="font-mono">(<%= icon(trend.icon, size: "sm", color: "current", class: "mb-0.5 inline") %><%= trend.percent_formatted %>)</span>
|
2024-10-07 16:20:36 -04:00
|
|
|
<% end %>
|
2025-04-28 13:57:32 -05:00
|
|
|
<span class="text-secondary">
|
|
|
|
<%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
|
|
|
|
</span>
|
2024-03-06 09:56:59 -05:00
|
|
|
<% end %>
|
2024-04-09 16:08:58 +04:00
|
|
|
</p>
|