<span class="tray-hide" data-logged-user="true">
<div class="card prodcard">
	<div class="card-body" >
		<table class="table table-sm table-hover ">{{-- table-bordered --}}
  <thead>
    <tr class="row small">
      <th class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Código</th>
      <th class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Nome</th>
      <th class="col-xs-7 col-sm-5 col-md-5 col-lg-4">E-mail</th>
      <th class="text-center col-xs-3 col-sm-3 col-md-3 col-lg-4">Ação</th>
    </tr>
  </thead>
  <tbody>
  	@foreach ($users as $user)
      @if($user->name <> 'admin')
      <tr class="row">
		    <td class="col-xs-2 col-sm-2 col-md-2 col-lg-2">{{$user->id}} </td>
		    <td class="col-xs-2 col-sm-2 col-md-2 col-lg-2">{{$user->name}}</td>
		    <td class="col-xs-5 col-sm-5 col-md-5 col-lg-4">{{$user->email}}
          @if(Auth::user()->name === $user->name)
            <span class="right badge badge-danger" >Logado</span>
          @endif
        </td>
		    <td class="text-center col-xs-3 col-sm-3 col-md-3 col-lg-4">
		    	<button class="btn btn-sm btn-outline-success col-lg-4 col-md-6 col-sm-12" type="button" data-bs-toggle="modal" data-bs-target="#modalEditar{{$user->id}}">Editar</button>
          <button class="btn btn-sm btn-outline-danger col-lg-4 col-md-6 col-sm-12" type="button" data-bs-toggle="modal" data-bs-target="#modalDel{{$user->id}}">Deletar</button>
		    </td>
		  </tr>
      @endif
      {{-- modalAddUser --}}
      @include('painel._includes.modalEditarUser')
      {{-- !modalAddUser --}}
				<div class="modal fade" id="modalDel{{$user->id}}" tabindex="-1" role="dialog" aria-labelledby="modalDel.{{$user->id}}" aria-hidden="true">
					  <div class="modal-dialog modal-dialog" role="document">
					    <div class="modal-content">
					      <div class="modal-header text-center">
					        <h5 class="text-center">Deseja realmente excluir este usuário?</h5>
					      </div>
		            <div class=" modal-footer align-content-center">
		              <button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
		              <button type="button" class="btn btn-danger " onclick="location.href = '{{ route('admin.deleteUser',$user->id  ) }}'" >Excluir</button>
		            </div>
					    </div>
					  </div>
					</div>
  	@endforeach
  </tbody>
</table>
    <hr>
    <button type="button" class="btn btn-primary" data-bs-toggle="modal"data-bs-target="#modalAddUser">
      Novo Usuário
    </button>

{{--  	<div class="row justify-content-sm-center pagprod">--}}
{{--           {{ $produtos->links() }}--}}
{{--    </div>--}}

	</div>
	</div>

<script src="{{ asset('site/jquery.js') }}"></script>
<script type="text/javascript">

  $('#v-pills-btn8-tab').addClass("active");
  $('#v-pills-btn1-tab').removeClass("active");

</script>

@include('painel._includes.modalAddUser')
