1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 23:45:21 +02:00
Maybe/app/views/shared/_trend_change.html.erb

18 lines
755 B
Text
Raw Permalink Normal View History

<%# locals: { trend:, comparison_label: nil } %>
<p class="text-sm" style="color: <%= trend.color %>">
<% if trend.direction.flat? %>
<%= t(".no_change") %><%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
<% else %>
<span class="font-mono">
<%= trend.value.is_a?(Money) ? format_money(trend.value) : trend.value.round(2) %>
</span>
<% unless trend.percent.infinite? %>
<span class="font-mono">(<%= icon(trend.icon, size: "sm", color: "current", class: "mb-0.5 inline") %><%= trend.percent_formatted %>)</span>
<% end %>
<span class="text-secondary">
<%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
</span>
<% end %>
</p>