<%= content_for :title, t(:'users.title') %>

<%= turbo_frame_tag 'main' do %>
  
  <%= turbo_stream.append 'flash', partial: 'layouts/flash' %>

  <div class="list-title">
    <h1><%= link_to yield(:title), params.permit(:sort, :reverse), class: 'list-title-link' %></h1>

    <div class="flex">
      <%= render 'material/search' %>      
      <%= link_to tag.span(t(:'ui.new')), url_for(action: 'new'), class: 'btn add-btn', data: {turbo_action: 'advance'} %>
    </div>
  </div>

  <div class="list-container">
    
    <div class="list" >

      <div class="list-header">
        <div class="cell"><%= link_to_sortable :by_name, t(:'activerecord.attributes.user.name') %></div>
        <div class="cell"><%= link_to_sortable :by_email, t(:'activerecord.attributes.user.email') %></div>
        <div class="cell"><%= t(:'activerecord.attributes.user.phone') %></div>
        <div class="cell"><%= t(:'activerecord.attributes.user.status') %></div>
    	  <div class="cell actions"></div>      
      </div>

      <div id="users">
        <%= render @users %>
      </div>
      
      <div class="pagination-container">
        <div><%= page_entries_info @users %></div>
        <%= paginate @users %>
      </div>


    </div>
  </div>

<% end %>