1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 15:19:38 +02:00
Maybe/app/views/shared/_circle_logo.html.erb
Zach Gollwitzer 45add7512b
Handle nil name for entries (#1550)
* Handle nil name for entries

* Fix tests
2024-12-16 12:52:11 -05:00

13 lines
438 B
Text

<%# locals: (name:, hex: nil, size: "md") %>
<% size_classes = {
"sm" => "w-6 h-6",
"md" => "w-9 h-9",
"lg" => "w-10 h-10",
"full" => "w-full h-full"
} %>
<%= tag.div style: mixed_hex_styles(hex),
class: [size_classes[size], "flex shrink-0 items-center justify-center rounded-full"] do %>
<%= tag.span (name.presence&.first || "T").upcase, class: ["font-medium", size == "sm" ? "text-xs" : "text-sm"] %>
<% end %>