but what if I want to put something else other than the p element like a group of elements and icons, how do I hide the element in case there is no flash alert?
I’d just not render anything if there’s no flash message to show. Imo the p:empty css phoenix uses is a clever way to handle no alerts, but also a bit to clever one.
I usually change this to something like this:
<%= for type <- [:info, :error], flash = get_flash(@conn, type) do %>
…
<% end %>