@extends('app.my-account.admin.users.single')

@section('details')

    <div class="my-4">
        <h4><b>Sessions</b></h4>
        <div class="table-responsive">
          <table class="table table-sm table-hover table-striped table-bordered mb-0">
              <thead>
              <tr>
                <th>Status</th>
                <th>Started At</th>
                <th>Ended At</th>
                <th>IP Address</th>
                <th>Device Type</th>
                <th>Last Activity</th>
                <th></th>
              </tr>
              </thead>
              <tbody>
                @foreach($sessions as $session)
                <tr>
                  <td>{{$session->is_active ? 'Active' : 'Inactive'}}</td>
                  <td>{{friendly_date_time($session->started_at)}}</td>
                  <td>{{friendly_date_time($session->ended_at)}}</td>
                  <td>{{$session->ip_address}}</td>
                  <td>{{$session->user_agent}}</td>
                  <td>{{friendly_date_time($session->last_activity_at)}}</td>
                  <td>@include('app.my-account.admin.users.forms.kill-session')</td>
                </tr>
                @endforeach
              </tbody>
            </table>
        </div>
    </div>

    <div class="mt-3">
        {{ $sessions->appends(request()->input())->links() }}
    </div>

@endsection
