ubicloud/views/components/flash_message.erb
Jeremy Evans 750ebdc055 Change from erb_formatter to herb/formatter
Currently, herb/formatter has at least 4 bugs the prevent us from
switching to it (https://github.com/marcoroth/herb/issues 476, 477,
478, and 479). This includes manual fixes for each issue.

herb/formatter also introduces a rubocop violation for the
Layout/AssignmentIndentation cop. This disables that cop.
2025-09-05 14:01:01 -07:00

23 lines
808 B
Text

<div class="-mt-6 mb-2 space-y-2">
<% [
["notice", "hero-check-circle-mini", "bg-green-50", "text-green-800", "text-green-400"],
["error", "hero-x-circle-mini", "bg-red-50", "text-red-800", "text-red-400"]
].each do |type, icon, bg_color, text_color, icon_color| %>
<% next unless flash[type] %>
<div class="rounded-md <%= bg_color %> p-4">
<div class="flex">
<div class="flex-shrink-0">
<%== part("components/icon", name: icon, classes: "h-5 w-5 #{icon_color}") %>
</div>
<div class="ml-3">
<h3
id="flash-<%= type %>"
class="text-sm font-medium <%= text_color %>"
>
<%= flash[type] %>
</h3>
</div>
</div>
</div>
<% end %>
</div>