<% content_for(:native_title, params[:status] == 'archived' ? t('archived_users') : (params[:status] == 'integration' ? t('embedding_users') : t('users'))) if turbo_native_app? %>
<%= render 'shared/settings_nav' %>

<% if params[:status] == 'archived' %> <%= t('archived_users') %> <% elsif params[:status] == 'integration' %> <%= t('embedding_users') %> <% else %> <%= t('users') %> <% end %>

<% if params[:status].blank? %> <% if can?(:create, User.new(account: current_account)) %> <% extra_buttons_html = render('users/extra_buttons') %> <% if content_for(:add_user_button) %> <%= content_for(:add_user_button) %> <% else %> <%= link_to new_user_path, class: 'shrink-0 md:order-3 btn btn-primary btn-md gap-2', title: t('new_user'), data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('new') %> <% end %> <% end %> <% else %>
<%= link_to '#', class: 'btn btn-primary btn-md gap-2 btn-disabled', title: t('new_user'), data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('new') %> <% end %>
<% end %> <% end %> <% if extra_buttons_html.present? %>
<%= extra_buttons_html %>
<% end %>
<% @users.each do |user| %> <% can_edit = params[:status].blank? && can?(:update, user) && user.archived_at.blank? %> <% can_remove = params[:status] != 'archived' && can?(:destroy, user) && user != current_user %> <% can_unarchive = params[:status] == 'archived' && can?(:create, user) && user != current_user && user.archived_at? %>
<%= user.initials.presence || user.email.first.upcase %>
<%= user.full_name.presence || user.email %> <%= t(user.role) %>
<% if user.try(:pending_reconfirmation?) %>
<%= user.unconfirmed_email %> (<%= t('unconfirmed') %>)
<% elsif user.full_name.present? %>
<%= user.email %>
<% end %>
<% if can_edit || can_remove || can_unarchive %> <% end %>
<% end %>
<% unless turbo_native_app? %> <% end %> <% if @pagy.pages > 1 %> <%= render 'shared/pagination', pagy: @pagy, items_name: 'users', left_additional_html: render('bottom_links') %> <% else %>
<%= render 'bottom_links' %>
<% end %>