Files
sure/app/views/accounts/_logo.html.erb
sentry[bot] f63630c0fa Fix NoMethodError on nil accountable for logo color (#1334)
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
2026-04-01 20:19:56 +02:00

23 lines
543 B
Plaintext

<%# 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.logo_url.present? %>
<%= image_tag account.logo_url,
class: "shrink-0 rounded-full #{size_classes[size]}",
loading: "lazy" %>
<% else %>
<%= render DS::FilledIcon.new(
variant: :text,
hex_color: color || account.accountable&.color,
text: account.name,
size: size,
rounded: true
) %>
<% end %>