2024-11-04 20:27:31 -05:00
|
|
|
<%# locals: (account:, title: nil, subtitle: nil) %>
|
|
|
|
|
|
|
|
<header class="space-y-4">
|
|
|
|
<div class="flex items-center gap-4">
|
|
|
|
<% content = yield %>
|
|
|
|
|
|
|
|
<% if content.present? %>
|
|
|
|
<%= content %>
|
|
|
|
<% else %>
|
2024-11-07 15:42:51 +01:00
|
|
|
<div class="flex items-center gap-3 overflow-hidden">
|
2024-11-04 20:27:31 -05:00
|
|
|
<%= render "accounts/logo", account: account %>
|
|
|
|
|
2024-11-07 15:42:51 +01:00
|
|
|
<div class="truncate">
|
|
|
|
<h2 class="font-medium text-xl truncate"><%= title || account.name %></h2>
|
2024-11-04 20:27:31 -05:00
|
|
|
<% if subtitle.present? %>
|
2025-02-13 11:31:07 -05:00
|
|
|
<p class="text-sm text-secondary"><%= subtitle %></p>
|
2024-11-04 20:27:31 -05:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="flex items-center gap-3 ml-auto">
|
2024-12-12 08:56:52 -05:00
|
|
|
<% if account.plaid_account_id.present? %>
|
|
|
|
<% if Rails.env.development? %>
|
|
|
|
<%= button_to sync_plaid_item_path(account.plaid_account.plaid_item), disabled: account.syncing?, data: { turbo: false }, class: "flex items-center gap-2", title: "Sync Account" do %>
|
2025-02-13 11:31:07 -05:00
|
|
|
<%= lucide_icon "refresh-cw", class: "w-4 h-4 text-secondary hover:text-subdued" %>
|
2024-12-12 08:56:52 -05:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2024-11-20 16:46:06 -05:00
|
|
|
<%= button_to sync_account_path(account), disabled: account.syncing?, data: { turbo: false }, class: "flex items-center gap-2", title: "Sync Account" do %>
|
2025-02-13 11:31:07 -05:00
|
|
|
<%= lucide_icon "refresh-cw", class: "w-4 h-4 text-secondary hover:text-subdued" %>
|
2024-11-15 13:49:37 -05:00
|
|
|
<% end %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= render "accounts/show/menu", account: account %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</header>
|