<% if !@emails.any? %>
<%= lucide_icon("mail-question", class: "stroke-warning") %>
<%= t(".no_emails", count: @emails.length) %>
<%= t(".no_emails_detail") %>
<% else %>
<%= t(".heading_new", count: @emails.length) %>
<% end %>
<% if @emails.any? %>
<% @emails.each do |email| %>
<%= lucide_icon(
email.verified? ? "mail-check" : "mail-question",
class: email.verified? ? "stroke-success" : "",
) %>
<%= email.email %>
<% if email.verified? %>
<%= t(".email_verified", ago: time_ago_in_words(email.verified_at)) %>
<% elsif email.taken? %>
<%= t(".email_taken") %>
<% elsif email.expired? %>
<%= t(".expired_verification") %>
<%= form_with url: emails_path, method: :patch do |form| %>
<% end %>
<% else %>
<%= t(".pending_verification") %>
<% end %>
<%= form_with url: emails_path, method: :delete, class: 'flex items-center gap-4' do |form| %>
<% end %>
<% end %>
<% end %>
<%= t(".add") %>
<% if flash[:errors]&.any? %>
<%= lucide_icon("mail-x", class: "stroke-error") %>
<%= flash[:errors][0] %>
<% end %>