The personal finance app for everyone (by everyone)
Ruby
<%# locals: (account:, href:, truncate: false, focus_ring: false) %>
<%# An account's logo, name, type and balance as one link. The balance stays on
one line, so a grouped amount like "1 284 960,00 kr" never breaks; a long
name wraps beside it, or with `truncate` stays on one line inside a narrow
grid cell. %>
<%= link_to href, class: class_names("bg-container-inset rounded-lg p-4 flex items-center justify-between gap-3 hover:bg-container-hover transition-colors", "focus-ring" => focus_ring) do %>
<div class="flex items-center gap-3 min-w-0">
<%= render "accounts/logo", account: account, size: "sm" %>
<div class="min-w-0">
<p class="<%= class_names("font-medium text-primary text-sm", truncate ? "truncate" : "break-words") %>"><%= account.name %></p>
<p class="<%= class_names("text-xs text-secondary", "truncate" => truncate) %>"><%= account.short_subtype_label %></p>
</div>
</div>
<p class="font-medium text-primary whitespace-nowrap privacy-sensitive"><%= format_money(account.balance_money) %></p>
<% end %>