<section class="sidemenu">
    <div class="logo">
        <a href="{{url('/admin')}}">
            <img src="{{asset( $settings['website_logo'] ?? '/assets/admin/images/logo.png' )}}" alt="">
            <!-- <img src="{{asset('/assets/admin/images/logo.png')}}" alt=""> -->
        </a>
    </div>

    <ul class="sidemenu-links">
        <li class="{{ $activeMenu[""] ?? '' }}">
            <a href="{{url('/admin')}}"> <i class="fas fa-chart-line"></i> <span>Dashboard</span></a>
        </li>
        @foreach ($currentUserInfo->modules->toArray() as $module)
        @if ( in_array( $module['path'] , ['loops', 'settings'] ) )
        <li class="{{ $activeMenu[ $module['path'] ] ?? '' }}">
            <a href="{{ url("admin/{$module['path']}") }}">
                <i class="{{ __($module['path'].'.menuIcon') ?? 'fas fa-edit' }}"></i> <span> {{ __($module['path'].'.head') }} </span>
            </a>
        </li>
        @else
        <li class="linkGroup {{ $activeMenu[ $module['path'] ] ?? '' }}">
            <a href="javascript:void" class="linkItem-head">
                <i class="{{ __($module['path'].'.menuIcon') ?? 'fas fa-edit' }}"></i>
                <span> {{ __($module['path'].'.head') }} </span>
            </a>
            <ul class="linkItem-body">
                <li>
                    <a href='{{ url("admin/{$module['path']}") }}'>{{ __($module['path'].'.head') }}</a>
                </li>
                <li>
                    <a href="{{ url("admin/{$module['path']}/create")  }}">{{ __($module['path'].'.new')}}</a>
                </li>

            </ul>
        </li>
        @endif

        @endforeach
        <li>
            <a data-toggle="modal" data-target="#logout" href="{{ route('admin_logout') }}" ><i class="fas fa-sign-out-alt"></i> <span> {{ __('Logout') }} </span></a>
        </li>
    </ul>
</section>



{{-- Log out Modal --}}

<!-- Modal -->
<div class="modal fade" id="logout" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Log out Confirmation</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <h3>Are you sure ? <i class="fa fa-exclamation-circle text-danger"></i></h3>
                <form id="logout-form-side" action="{{ route('admin_logout') }}" method="POST" style="display: none;">
                    @csrf
                </form>
            </div>
            <div class="modal-footer justify-content-between">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button onclick="document.getElementById('logout-form-side').submit()" type="button" class="btn btn-primary">{{__('Logout')}}</button>
            </div>
        </div>
    </div>
</div>
