<%= render 'shared/settings_nav' %>

Users

<% if can?(:create, User.new(account: current_account)) %> <%= link_to new_user_path, class: 'btn btn-primary btn-md gap-2', data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> New User <% end %> <% end %>
<% @users.each do |user| %> <% end %>
Name Email Role Last session
<%= user.full_name %> <%= user.email %> <%= user.role %> <%= user.last_sign_in_at ? l(user.last_sign_in_at.in_time_zone(current_account.timezone), format: :short, locale: current_account.locale) : '-' %> <% if can?(:update, user) %> <%= link_to edit_user_path(user), class: 'btn btn-outline btn-xs', title: 'Edit', data: { turbo_frame: 'modal' } do %> Edit <% end %> <% end %> <% if can?(:destroy, user) && user != current_user %> <%= button_to user_path(user), method: :delete, class: 'btn btn-outline btn-error btn-xs', title: 'Delete', data: { turbo_confirm: 'Are you sure?' } do %> Remove <% end %> <% end %>
<%= render 'shared/pagination', pagy: @pagy, items_name: 'users' %>