<aside class="sidenav navbar navbar-vertical navbar-expand-xs border-0 border-radius-xl my-3 {{ config('langDirection') == 'ltr' ? 'fixed-start' : 'fixed-end' }} ms-3"
       id="sidenav-main">
    <div class="sidenav-header text-center">
        <i class="fas fa-times p-3 cursor-pointer text-secondary opacity-5 position-absolute end-0 top-0 d-none d-xl-none"
           aria-hidden="true" id="iconSidenav"></i>
        <a class="m-0 pt-3 navbar-brand text-wrap" href="{{ route('dashboard') }}">
            <h3 class="font-weight-bold">{{ getOption('ui', 'brand', 'Keevault') }}</h3>
        </a>
    </div>
    <hr class="horizontal dark mt-0">
    <div class="collapse navbar-collapse w-auto" id="sidenav-collapse-main">
        <ul class="navbar-nav">

            @if( can( 'dashboard' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'dashboard' ? 'active' : '' }}"
                       href="{{ route('dashboard') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-chart-line ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['dashboard']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">Dashboard</span>
                    </a>
                </li>
            @endif

            @if( can( 'license-keys' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'license-keys' ? 'active' : '' }}"
                       href="{{ route('license-keys') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-key ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['license-keys']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('License Keys') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'generators' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'generators' ? 'active' : '' }}"
                       href="{{ route('generators') }}">
                        <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-cogs ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['generators']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Generators') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'products' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'products' ? 'active' : '' }}"
                       href="{{ route('products') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-box list-ul ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['products']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Products') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'activations' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'activations' ? 'active' : '' }}"
                       href="{{ route('activations') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-bolt ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['activations']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Activations') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'downloadables' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'downloadables' ? 'active' : '' }}"
                       href="{{ route('downloadables') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-download ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['downloadables']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Downloadables') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'api-keys' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'api-keys' ? 'active' : '' }}"
                       href="{{ route('api-keys') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-terminal ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['api-keys']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('API Keys') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'users' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'users' ? 'active' : '' }}"
                       href="{{ route('users') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-users ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['users']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Users') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'logs' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'logs' ? 'active' : '' }}"
                       href="{{ route('logs') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-users ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['logs']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Logs') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'telemetry' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'telemetry' ? 'active' : '' }}"
                       href="{{ route('telemetry') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-users ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['telemetry']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Telemetry') }}</span>
                    </a>
                </li>
            @endif

            @if( can( 'settings' ) )
                <li class="nav-item pb-2">
                    <a class="nav-link {{ Route::currentRouteName() == 'settings' ? 'active' : '' }}"
                       href="{{ route('settings') }}">
                        <div
                            class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
                            <i style="font-size: 1rem;" class="fas fa-lg fa-cog ps-2 pe-2 text-center
                        {{ in_array(request()->route()->getName(),['settings']) ? 'text-white' : 'text-dark' }}"></i>
                        </div>
                        <span class="nav-link-text ms-1">{{ __('Settings') }}</span>
                    </a>
                </li>
            @endif
        </ul>
    </div>
</aside>
