<%= render 'shared/settings_nav' %>

<%= t('teams') %>

<% if can?(:create, Team.new(account: current_account)) %> <%= link_to new_settings_team_path, class: 'btn btn-primary btn-md gap-2 w-full md:w-fit', data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('new_team') %> <% end %> <% end %>
<% @teams.each do |team| %> <% end %>
<%= t('name') %> <%= t('members') %>
<%= team.name %> <%= team.active_users_count %> <% if can?(:update, team) %> <%= link_to edit_settings_team_path(team), class: 'btn btn-outline btn-xs', title: t('edit'), data: { turbo_frame: 'modal' } do %> <%= t('edit') %> <% end %> <% end %> <% if can?(:destroy, team) && team.active_users_count == 0 %> <%= button_to settings_team_path(team), method: :delete, class: 'btn btn-outline btn-error btn-xs', title: t('archive'), data: { turbo_confirm: t('are_you_sure_') } do %> <%= t('archive') %> <% end %> <% end %>