Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby
645 B
Raw Blame
<%= turbo_frame_tag "#{@accountable.model_name.param_key}_sparkline" do %>
  <div class="flex items-center justify-end gap-1">
    <div class="w-8 h-3">
      <%= render "shared/sparkline", id: dom_id(@accountable, :sparkline_chart), series: @series %>
    </div>

    <%# A previous value of zero makes the percentage infinite, with nothing useful to print %>
    <% if @series.trend && @series.trend.percent.finite? %>
      <%= tag.p @series.trend.percent_formatted,
                  style: "color: #{@series.trend.color}",
                  class: "font-mono text-right text-xs font-medium text-primary" %>
    <% end %>
  </div>
<% end %>