@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 mr-2"></i>
        <span>Dasbor</span>
    </a>
</li>

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-advancedui" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-cart mr-2"></i>Pesanan <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="topnav-advancedui">
        <a href="{{ url('order/new') }}" class="dropdown-item">Pesan Baru</a>
        <a href="{{ url('order/history') }}" class="dropdown-item">Riwayat</a>
        <a href="{{ url('page/service/monitoring') }}" class="dropdown-item">Monitoring Layanan</a>
    </div>
</li>

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

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-advancedui" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-wallet mr-2"></i>Deposit <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="topnav-advancedui">
        <a href="{{ url('deposit/new') }}" class="dropdown-item">Deposit Baru</a>
        <a href="{{ url('deposit/history') }}" class="dropdown-item">Riwayat</a>
    </div>
</li>

<li class="nav-item">
    <a class="nav-link" href="{{ url('ticket/list') }}">
        <i class="mdi mdi-ticket-account mr-2"></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 mr-2"></i>
        <span>Daftar Layanan</span>
    </a>
</li>

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-advancedui" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-sitemap mr-2"></i>Sitemap <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="topnav-advancedui">
        <a href="{{ url('page/hof') }}" class="dropdown-item">Top Terbaik</a>
        @foreach (\App\Models\WebsitePage::all() as $item)
        <a href="{{ url('page/site/'.$item->slug.'') }}" class="dropdown-item">{{ $item->title }}</a>
        @endforeach
    </div>
</li>

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

@else

<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 mr-2"></i>
        <span>Dasbor</span>
    </a>
</li>

<li class="nav-item">
    <a class="nav-link" href="{{ url('auth/login') }}">
        <i class="mdi mdi-account-arrow-right mr-2"></i>
        <span>Masuk</span>
    </a>
</li>

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

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

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

<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-advancedui" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <i class="mdi mdi-sitemap mr-2"></i>Sitemap <div class="arrow-down"></div>
    </a>
    <div class="dropdown-menu" aria-labelledby="topnav-advancedui">
        <a href="{{ url('page/hof') }}" class="dropdown-item">Top Terbaik</a>
        @foreach (\App\Models\WebsitePage::all() as $item)
        <a href="{{ url('page/site/'.$item->slug.'') }}" class="dropdown-item">{{ $item->title }}</a>
        @endforeach
    </div>
</li>
@endif