1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-07 06:25:19 +02:00
Maybe/app/views/shared/_trend_change.html.erb

15 lines
499 B
Text
Raw Normal View History

<%# locals: { trend: } %>
<p class="text-sm" style="color: <%= trend.color %>">
<% if trend.direction.flat? %>
<span>No change</span>
<% 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">(<%= lucide_icon(trend.icon, class: "w-4 h-4 align-text-bottom inline") %><%= trend.percent_formatted %>)</span>
<% end %>
<% end %>
</p>