Files
sure/app/views/redbark_items/select_existing_account.html.erb
T
Will WilsonandClaude Opus 4.8 6cf9999dbe fix(design-system): resolve DS drift patrol findings (#2836) (#2867)
- redbark_items/_redbark_item: render via DS::Disclosure(variant: :card)
  instead of a hand-rolled <details>, matching the lunchflow_items pattern
- replace dead btn/btn--primary/btn--sm classes (defined nowhere) with
  DS::Link in select_existing_account and DS::Button in _redbark_panel
- add functional bg-subdued token (= gray-400, mirroring text-subdued) and
  use it for the money-flow expense legend dots in place of literal
  bg-gray-400, keeping them in sync with the chart's gray expense bars

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-04 23:12:04 +02:00

71 lines
2.9 KiB
ERB

<% content_for :title, t("redbark_items.select_existing_account.title") %>
<%= render DS::Dialog.new do |dialog| %>
<% dialog.with_header(title: t("redbark_items.select_existing_account.header")) do %>
<div class="flex items-center gap-2">
<%= icon "link", class: "text-primary" %>
<span class="text-primary"><%= t("redbark_items.select_existing_account.subtitle", account_name: @account.name) %></span>
</div>
<% end %>
<% dialog.with_body do %>
<% if @redbark_accounts.blank? %>
<div class="text-center py-8">
<%= icon "alert-circle", class: "text-warning mx-auto mb-4", size: "lg" %>
<p class="text-secondary"><%= t("redbark_items.select_existing_account.no_accounts") %></p>
<p class="text-sm text-secondary mt-2"><%= t("redbark_items.select_existing_account.connect_hint") %></p>
<%= render DS::Link.new(
text: t("redbark_items.select_existing_account.settings_link"),
variant: "primary",
size: "sm",
href: settings_providers_path,
class: "mt-4"
) %>
</div>
<% else %>
<div class="space-y-4">
<div class="bg-surface border border-primary p-4 rounded-lg mb-4">
<p class="text-sm text-primary">
<strong><%= t("redbark_items.select_existing_account.linking_to") %></strong>
<%= @account.name %>
</p>
</div>
<% @redbark_accounts.each do |redbark_account| %>
<%= form_with url: link_existing_account_redbark_items_path,
method: :post,
local: true,
class: "border border-primary rounded-lg p-4 hover:bg-surface transition-colors" do |form| %>
<%= hidden_field_tag :account_id, @account.id %>
<%= hidden_field_tag :redbark_account_id, redbark_account.id %>
<div class="flex items-center justify-between">
<div>
<h4 class="font-medium text-primary"><%= redbark_account.name %></h4>
<p class="text-sm text-secondary">
<%= t("redbark_items.select_existing_account.balance_label") %>
<%= number_to_currency(redbark_account.current_balance || 0, unit: Money::Currency.new(redbark_account.currency || "USD").symbol) %>
</p>
</div>
<%= render DS::Button.new(
text: t("redbark_items.select_existing_account.link_button"),
variant: "primary",
size: "sm",
type: "submit"
) %>
</div>
<% end %>
<% end %>
</div>
<div class="mt-6">
<%= render DS::Link.new(
text: t("redbark_items.select_existing_account.cancel_button"),
variant: "secondary",
href: account_path(@account)
) %>
</div>
<% end %>
<% end %>
<% end %>