Files
sure/app/views/shared/_trend_change.html.erb
Alex Hatzenbuhler 341a800b65 Improve dashboard/account charts and tooltips (#2157)
* Improve net worth hover

* Improve graph tooltip

* Use locales files for some text on net worth and account charts

* Consolidate and simplify trend change between net worth and account charts

* Fix test and self-review stuff

* Clean up some stuff on the holding sidebar
2025-04-28 14:57:32 -04:00

18 lines
751 B
Plaintext

<%# 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">(<%= lucide_icon(trend.icon, class: "w-4 h-4 align-text-bottom inline") %><%= trend.percent_formatted %>)</span>
<% end %>
<span class="text-secondary">
<%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
</span>
<% end %>
</p>