Files
sure/app/views/transactions/_transfer_match.html.erb
Guillem Arias Fauste 3d182bc67a refactor(transactions): migrate transfer_match badges to DS::Pill (#1939)
Follow-up to #1917 — the responsive label-swap pair in
`_transfer_match.html.erb` was deferred because DS::Pill has no
caller-controlled `class:` arg yet. Wrapping each `DS::Pill` in a
`<span>` with the responsive visibility classes (`hidden lg:inline` /
`inline lg:hidden`) gets the same effect without expanding the
component API — the parent span's `display` controls visibility, the
child pill keeps its own `inline-flex` chrome when visible.

Closes the last open callsite from #1917's deferred-list. Same tone
(`:neutral`) and shape (`marker: false` rounded-full) as the other
neutral status badges migrated in PR B.
2026-05-24 12:16:03 +02:00

42 lines
1.7 KiB
Plaintext

<%# locals: (transaction:) %>
<div id="<%= dom_id(transaction, "transfer_match") %>" class="flex items-center gap-1">
<% if transaction.transfer.confirmed? %>
<span title="<%= transaction.transfer.payment? ? t("transactions.transfer_match.payment_confirmed") : t("transactions.transfer_match.transfer_confirmed") %>">
<%= icon "link-2", size: "sm", class: "text-secondary" %>
</span>
<% elsif transaction.transfer.pending? %>
<span class="hidden lg:inline">
<%= render DS::Pill.new(
label: t("transactions.transfer_match.auto_matched"),
tone: :neutral,
marker: false,
show_dot: false
) %>
</span>
<span class="inline lg:hidden">
<%= render DS::Pill.new(
label: t("transactions.transfer_match.auto_matched_short"),
tone: :neutral,
marker: false,
show_dot: false
) %>
</span>
<%= button_to transfer_path(transaction.transfer, transfer: { status: "confirmed" }),
method: :patch,
class: "text-secondary flex items-center justify-center cursor-pointer",
title: t("transactions.transfer_match.confirm_match") do %>
<%= icon "check", size: "sm", class: "text-secondary hover:text-primary" %>
<% end %>
<%= button_to transfer_path(transaction.transfer, transfer: { status: "rejected" }),
method: :patch,
data: { turbo: false },
class: "text-secondary hover:text-primary flex items-center justify-center cursor-pointer",
title: t("transactions.transfer_match.reject_match") do %>
<%= icon "x", size: "sm", class: "text-subdued hover:text-primary" %>
<% end %>
<% end %>
</div>