58 lines
2.5 KiB
Plaintext
58 lines
2.5 KiB
Plaintext
<%= render HeaderComponent.new(title: "Wallet") %>
|
|
|
|
<%= render MainSimpleComponent.new do %>
|
|
<%= render WalletSummaryComponent.new(balance: @balance) %>
|
|
|
|
<section>
|
|
<div class="border-b border-gray-200">
|
|
<nav class="-mb-px flex" aria-label="Tabs">
|
|
<%= link_to "Info", wallet_path, class: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 w-1/2 py-4 px-1 text-center border-b-2" %>
|
|
<%= link_to "Transactions", wallet_transactions_path, class: "border-indigo-500 text-indigo-600 w-1/2 py-4 px-1 text-center border-b-2", "aria-current": "page" %>
|
|
</nav>
|
|
</div>
|
|
</section>
|
|
|
|
<section>
|
|
<h3 class="hidden">Transactions</h3>
|
|
|
|
<% if @transactions.any? %>
|
|
<ul class="list-none">
|
|
<% @transactions.each do |tx| %>
|
|
<li class="py-4 md:py-4 grid gap-y-1 gap-x-2 grid-cols-4 border-b border-dotted border-gray-300">
|
|
<h3 class="col-span-2 md:col-span-3 mb-0">
|
|
<% if tx["type"] == "bitcoind_tx" %>
|
|
<span class="inline-block">
|
|
<%= render partial: "icons/link-2", locals: { custom_class: "text-emerald-500 h-4 w-4 mr-0.5" } %>
|
|
</span>
|
|
<% else %>
|
|
<span class="inline-block">
|
|
<%= render partial: "icons/zap", locals: { custom_class: "text-amber-500 h-4 w-4 mr-0.5" } %>
|
|
</span>
|
|
<% end %>
|
|
<%= tx["title"] %>
|
|
</h3>
|
|
<p class="col-span-2 md:col-span-1 mb-0 text-right">
|
|
<span class="text-xl font-mono <%= tx["received"] ? "text-emerald-600" : "" %>">
|
|
<%= tx["received"] ? "+" : "" %><%= number_with_delimiter tx["amount_sats"] %>
|
|
<span class="hidden md:inline">sats</span>
|
|
</span>
|
|
</p>
|
|
<p class="col-span-4 md:col-span-3 mb-0 text-gray-500">
|
|
<%= tx["description"].present? ? tx["description"] : raw("<span class='text-gray-400'>No memo</span>") %>
|
|
</p>
|
|
<p class="col-span-4 md:col-span-1 md:text-right mb-0">
|
|
<span class="col-span-2 md:col-span-1 text-sm text-gray-500">
|
|
<%= tx["datetime"].strftime("%B %e, %H:%M") %>
|
|
</span>
|
|
</p>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% else %>
|
|
<p class="text-gray-500">
|
|
No transactions yet. As soon as you start receiving sats, you will find some entries here.
|
|
</p>
|
|
<% end %>
|
|
</section>
|
|
<% end %>
|