2024-12-10 17:41:20 -05:00
|
|
|
<%# locals: (entry:, selectable: true, balance_trend: nil) %>
|
2024-07-01 10:49:43 -04:00
|
|
|
|
2024-12-10 17:41:20 -05:00
|
|
|
<% color = balance_trend&.trend&.color || "#D444F1" %>
|
|
|
|
<% icon = balance_trend&.trend&.icon || "plus" %>
|
2024-11-04 20:27:31 -05:00
|
|
|
|
|
|
|
<div class="p-4 grid grid-cols-12 items-center text-gray-900 text-sm font-medium">
|
|
|
|
<div class="col-span-8 flex items-center gap-4">
|
|
|
|
<% if selectable %>
|
|
|
|
<%= check_box_tag dom_id(entry, "selection"),
|
|
|
|
class: "maybe-checkbox maybe-checkbox--light",
|
|
|
|
data: { id: entry.id, "bulk-select-target": "row", action: "bulk-select#toggleRowSelection" } %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="flex items-center gap-3">
|
2024-12-10 17:41:20 -05:00
|
|
|
<%= tag.div class: "w-8 h-8 rounded-full p-1.5 flex items-center justify-center", style: mixed_hex_styles(color) do %>
|
|
|
|
<%= lucide_icon icon, class: "w-4 h-4" %>
|
2024-06-21 16:23:28 -04:00
|
|
|
<% end %>
|
|
|
|
|
2024-11-04 20:27:31 -05:00
|
|
|
<div class="truncate text-gray-900">
|
|
|
|
<% if entry.new_record? %>
|
2024-12-19 10:16:09 -05:00
|
|
|
<%= content_tag :p, entry.display_name %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<% else %>
|
2024-12-19 10:16:09 -05:00
|
|
|
<%= link_to entry.display_name,
|
2024-11-27 16:01:50 -05:00
|
|
|
account_entry_path(entry),
|
2024-11-04 20:27:31 -05:00
|
|
|
data: { turbo_frame: "drawer", turbo_prefetch: false },
|
|
|
|
class: "hover:underline hover:text-gray-800" %>
|
|
|
|
<% end %>
|
2024-06-21 16:23:28 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-11-04 20:27:31 -05:00
|
|
|
</div>
|
2024-06-21 16:23:28 -04:00
|
|
|
|
2024-12-10 17:41:20 -05:00
|
|
|
<div class="col-span-2 justify-self-end font-medium text-sm">
|
|
|
|
<% if balance_trend&.trend %>
|
|
|
|
<%= tag.span format_money(balance_trend.trend.value), style: "color: #{balance_trend.trend.color}" %>
|
|
|
|
<% else %>
|
|
|
|
<%= tag.span "--", class: "text-gray-400" %>
|
|
|
|
<% end %>
|
2024-11-04 20:27:31 -05:00
|
|
|
</div>
|
2024-06-21 16:23:28 -04:00
|
|
|
|
2024-11-04 20:27:31 -05:00
|
|
|
<div class="col-span-2 justify-self-end">
|
|
|
|
<%= tag.p format_money(entry.amount_money), class: "font-medium text-sm text-gray-900" %>
|
2024-06-21 16:23:28 -04:00
|
|
|
</div>
|
2024-11-04 20:27:31 -05:00
|
|
|
</div>
|