mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 23:04:49 +00:00
23 lines
1.0 KiB
Plaintext
23 lines
1.0 KiB
Plaintext
<%# locals: (label:, period:, balance:, trend:, size: "lg")%>
|
|
<div class="space-y-2">
|
|
<p class="text-sm text-gray-500"><%= label %></p>
|
|
<p class="text-gray-900 -space-x-0.5">
|
|
<span class="text-gray-500"><%= balance.currency.symbol %></span>
|
|
<span class="<%= size == "lg" ? "text-xl" : "text-lg" %> font-medium"><%= format_money_without_symbol balance, precision: 0 %></span>
|
|
<%- if balance.currency.default_precision.positive? -%>
|
|
<span class="text-gray-500">
|
|
<%= balance.currency.separator %><%= balance.cents_str %>
|
|
</span>
|
|
<% end %>
|
|
</p>
|
|
<% if trend.nil? %>
|
|
<p class="text-sm text-gray-500">Data not available for the selected period</p>
|
|
<% elsif trend.direction == "flat" %>
|
|
<p class="text-sm text-gray-500">No change vs. prior period</p>
|
|
<% else %>
|
|
<div class="flex items-center gap-2">
|
|
<%= render partial: "shared/trend_change", locals: { trend: trend } %>
|
|
<span class="text-sm text-gray-500"><%= period_label(period) %></span>
|
|
</div>
|
|
<% end %>
|
|
</div> |