@extends('layouts.dashb5')
@section('title', 'Alliance Services - Dashboard')

@section('upper-navbar')
<nav class="navbar sticky-top navbar-expand-lg border-bottom bg-body-tertiary">
    <div class="container-fluid">
        <!-- Left navbar links -->
        <ul class="navbar-nav">
            <li class="nav-item d-none d-sm-inline-block">
            <a href="/dashboard" class="nav-link">Dashboard</a>
            </li>
        </ul>
        <!-- Right navbar links -->
        <ul class="navbar-nav ms-auto">
            <!-- Notifications Dropdown Menu -->
            <li class="nav-item dropdown">
            <a class="nav-link" href="#">
                <i class="fas fa-fighter-jet"></i>
                <span class="badge badge-warning navbar-badge">{{ auth()->user()->srpOpen() ?? 0 }}</span>
            </a>
            </li>
            <li class="nav-item dropdown">
            <a class="nav-link" href="#">
                <i class="fas fa-plane-slash"></i>
                <span class="badge badge-danger navbar-badge">{{ auth()->user()->srpDenied() ?? 0 }}</span>
            </a>
            </li>
            <li class="nav-item dropdown">
            <a class="nav-link" href="#">
                <i class="fas fa-space-shuttle"></i>
                <span class="badge badge-success navbar-badge">{{ auth()->user()->srpApproved() ?? 0 }}</span>
            </a>
            </li>
        </ul>

        @include('layouts.darkmode')
      </div>
    </div>
</nav>
@endsection

@section('content-navigation')
<div class="row"> <!-- This section creates the links at the top separated by a / -->
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item inactive" aria-current="#">Overview</li>
            <li class="breadcrumb-item active" aria-current="#">Dashboard</li>
        </ol>
    </nav>
</div>
@endsection

@section('content')
    <div class="row my-4">
        <div class="col-12 col-md-6 col-lg-3 mb-4 mb-lg-0">
        <div class="card">
            <h5 class="card-header">Customers</h5>
            <div class="card-body">
            <h5 class="card-title">345k</h5>
            <p class="card-text">Feb 1 - Apr 1, United States</p>
            <p class="card-text text-success">18.2% increase since last month</p>
            </div>
        </div>
        </div>
        <div class="col-12 col-md-6 mb-4 mb-lg-0 col-lg-3">
        <div class="card">
            <h5 class="card-header">Revenue</h5>
            <div class="card-body">
            <h5 class="card-title">$2.4k</h5>
            <p class="card-text">Feb 1 - Apr 1, United States</p>
            <p class="card-text text-success">4.6% increase since last month</p>
            </div>
        </div>
        </div>
        <div class="col-12 col-md-6 mb-4 mb-lg-0 col-lg-3">
        <div class="card">
            <h5 class="card-header">Purchases</h5>
            <div class="card-body">
            <h5 class="card-title">43</h5>
            <p class="card-text">Feb 1 - Apr 1, United States</p>
            <p class="card-text text-danger">2.6% decrease since last month</p>
            </div>
        </div>
        </div>
        <div class="col-12 col-md-6 mb-4 mb-lg-0 col-lg-3">
        <div class="card">
            <h5 class="card-header">Traffic</h5>
            <div class="card-body">
            <h5 class="card-title">64k</h5>
            <p class="card-text">Feb 1 - Apr 1, United States</p>
            <p class="card-text text-success">2.5% increase since last month</p>
            </div>
        </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-xl-8 mb-4 mb-lg-0">
        <div class="card">
            <h5 class="card-header">Latest transactions</h5>
            <div class="card-body">
            <div class="table-responsive">
                <table class="table">
                <thead>
                    <tr>
                    <th scope="col">Order</th>
                    <th scope="col">Product</th>
                    <th scope="col">Customer</th>
                    <th scope="col">Total</th>
                    <th scope="col">Date</th>
                    <th scope="col"></th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                    <th scope="row">17371705</th>
                    <td>Volt Premium Bootstrap 5 Dashboard</td>
                    <td>johndoe@gmail.com</td>
                    <td>€61.11</td>
                    <td>Aug 31 2020</td>
                    <td><a href="#" class="btn btn-sm btn-primary">View</a></td>
                    </tr>
                    <tr>
                    <th scope="row">17370540</th>
                    <td>Pixel Pro Premium Bootstrap UI Kit</td>
                    <td>jacob.monroe@company.com</td>
                    <td>$153.11</td>
                    <td>Aug 28 2020</td>
                    <td><a href="#" class="btn btn-sm btn-primary">View</a></td>
                    </tr>
                    <tr>
                    <th scope="row">17371705</th>
                    <td>Volt Premium Bootstrap 5 Dashboard</td>
                    <td>johndoe@gmail.com</td>
                    <td>€61.11</td>
                    <td>Aug 31 2020</td>
                    <td><a href="#" class="btn btn-sm btn-primary">View</a></td>
                    </tr>
                    <tr>
                    <th scope="row">17370540</th>
                    <td>Pixel Pro Premium Bootstrap UI Kit</td>
                    <td>jacob.monroe@company.com</td>
                    <td>$153.11</td>
                    <td>Aug 28 2020</td>
                    <td><a href="#" class="btn btn-sm btn-primary">View</a></td>
                    </tr>
                    <tr>
                    <th scope="row">17371705</th>
                    <td>Volt Premium Bootstrap 5 Dashboard</td>
                    <td>johndoe@gmail.com</td>
                    <td>€61.11</td>
                    <td>Aug 31 2020</td>
                    <td><a href="#" class="btn btn-sm btn-primary">View</a></td>
                    </tr>
                    <tr>
                    <th scope="row">17370540</th>
                    <td>Pixel Pro Premium Bootstrap UI Kit</td>
                    <td>jacob.monroe@company.com</td>
                    <td>$153.11</td>
                    <td>Aug 28 2020</td>
                    <td><a href="#" class="btn btn-sm btn-primary">View</a></td>
                    </tr>
                </tbody>
                </table>
            </div>
            <a href="#" class="btn btn-block btn-light">View all</a>
            </div>
        </div>
        </div>
        <div class="col-12 col-xl-4">
        <div class="card">
            <h5 class="card-header">Traffic last 6 months</h5>
            <div class="card-body">
            <div id="traffic-chart"></div>
            </div>
        </div>
        </div>
    </div>

    <div class="row">
        <div class="col-12 col-xl-8 mb-4 mb-lg-0">
        <div class="card">
            <h5 class="card-header">JWT Status</h5>
            <div class="card-body">
            <div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-3">

                    <p class="text-sm text-gray-500 dark:text-gray-400">Issued At</p>
                    <p class="mt-1 text-sm font-medium text-gray-800 dark:text-white/90">
                        {{ optional($authUser->user_jwt_issued_at)?->toDateTimeString() ?? 'N/A' }}
                    </p>


                    <p class="text-sm text-gray-500 dark:text-gray-400">Expires At</p>
                    <p class="mt-1 text-sm font-medium text-gray-800 dark:text-white/90">
                        {{ optional($authUser->user_jwt_expires_at)?->toDateTimeString() ?? 'N/A' }}
                    </p>



                    <p class="text-sm text-gray-500 dark:text-gray-400">Privileges Version</p>
                    <p class="mt-1 text-sm font-medium text-gray-800 dark:text-white/90">
                        {{ $authUser->privileges_version ?? 1 }}
                    </p>

            </div>

            <div class="mt-4">
                <label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">Current JWT</label>
                <textarea rows="8" readonly class="w-full rounded-xl border border-gray-300 bg-gray-50 px-4 py-3 text-sm text-gray-700 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300">{{ $authUser->user_jwt }}</textarea>
            </div>
            </div>
        </div>
        </div>
    </div>
@endsection
