<%# locals: (account:, size: "md", color: nil) %>

<% size_classes = {
  "sm" => "w-6 h-6",
  "md" => "w-9 h-9",
  "lg" => "w-10 h-10",
  "full" => "w-full h-full"
} %>

<% if account.plaid_account_id? && account.institution_domain.present? %>
  <%= image_tag "https://logo.synthfinance.com/#{account.institution_domain}", class: "rounded-full #{size_classes[size]}" %>
<% elsif account.logo.attached? %>
  <%= image_tag account.logo, class: "rounded-full #{size_classes[size]}" %>
<% else %>
  <%= circle_logo(account.name, hex: color || account.accountable.color, size: size) %>
<% end %>
