@if (Auth::check() == true)
@php
$ticket_waiting = \App\Models\Ticket::where([['user_id', Auth::user()->id], ['is_read_user', '0']])->count();
@endphp
<li class="nav-item @if (request()->path() == '/') mm-active @endif">
    <a href="{{ url('/') }}" class="nav-link @if (request()->path() == '/') active @endif">
        <i class="mdi mdi-store-outline"></i>
        <span>Dasbor</span>
    </a>
</li>

<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect">
        <i class="mdi mdi-cart-outline"></i>
        <span>Pesanan</span>
    </a>
    <ul class="sub-menu" aria-expanded="false">
        <li><a href="{{ url('order/new') }}" class="dropdown-item">Pesan Baru</a></li>
        <li><a href="{{ url('order/history') }}" class="dropdown-item">Riwayat</a></li>
        <li><a href="{{ url('page/service/monitoring') }}" class="dropdown-item">Monitoring Layanan</a></li>
    </ul>
</li>

<li class="nav-item">
    <a class="nav-link" href="{{ url('order/refill/history') }}">
        <i class="mdi mdi-repeat"></i>
        <span>Refill</span>
    </a>
</li>

<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect">
        <i class="mdi mdi-wallet-outline"></i>
        <span>Deposit</span>
    </a>
    <ul class="sub-menu" aria-expanded="false">
        <li><a href="{{ url('deposit/new') }}" class="dropdown-item">Deposit Baru</a></li>
        <li><a href="{{ url('deposit/history') }}" class="dropdown-item">Riwayat</a></li>
    </ul>
</li>

<li class="nav-item">
    <a class="nav-link" href="{{ url('ticket/list') }}">
        <i class="mdi mdi-ticket-outline"></i>
        @if ($ticket_waiting > 0)
        <span class="badge badge-pill badge-warning float-right ml-1" style="margin-top: 6px;">{{ $ticket_waiting }}</span>
        @endif
        <span>Tiket</span>
    </a>
</li>

<li class="nav-item">
    <a class="nav-link" href="{{ url('page/service/list') }}">
        <i class="mdi mdi-tag-multiple-outline"></i>
        <span>Daftar Layanan</span>
    </a>
</li>

<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect">
        <i class="mdi mdi-sitemap-outline"></i>
        <span>Sitemap</span>
    </a>
    <ul class="sub-menu" aria-expanded="false">
        @foreach (\App\Models\WebsitePage::all() as $item)
        <li><a href="{{ url('page/site/'.$item->slug.'') }}">{{ $item->title }}</a></li>
        @endforeach
    </ul>
</li>

<li class="nav-item">
    <a class="nav-link" href="{{ url('page/api_doc') }}">
        <i class="mdi mdi-code-tags"></i>
        <span>Dokumentasi API</span>
    </a>
</li>

@else

<li>
    <a href="{{ url('/') }}" class="waves-effect">
        <i class="mdi mdi-store-outline"></i>
        <span>Dasbor</span>
    </a>
</li>

<li>
    <a href="{{ url('auth/login') }}" class="waves-effect">
        <i class="mdi mdi-account-arrow-right-outline"></i>
        <span>Masuk</span>
    </a>
</li>

@if (Route::has('user.register'))
<li>
    <a href="{{ url('auth/register') }}" class="waves-effect">
        <i class="mdi mdi-account-plus-outline"></i>
        <span>Daftar</span>
    </a>
</li>
@endif

@if (Route::has('user.reset'))
<li>
    <a href="{{ url('auth/reset') }}" class="waves-effect">
        <i class="mdi mdi-account-key-outline"></i>
        <span>Atur Ulang Kata Sandi</span>
    </a>
</li>
@endif

<li>
    <a href="{{ url('page/service/list') }}" class="waves-effect">
        <i class="mdi mdi-tag-multiple-outline"></i>
        <span>Daftar Layanan</span>
    </a>
</li>

<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect">
        <i class="mdi mdi-sitemap-outline"></i>
        <span>Sitemap</span>
    </a>
    <ul class="sub-menu" aria-expanded="false">
        @foreach (\App\Models\WebsitePage::all() as $item)
        <li><a href="{{ url('page/site/'.$item->slug.'') }}">{{ $item->title }}</a></li>
        @endforeach
    </ul>
</li>
@endif