@php
    $currentPath = request()->path();

    $dashboardActive = $currentPath === 'dashboard';

    $inventoryActive = request()->is('inventory/*');
    $categoryActive = request()->is('categories/*');
    $customerActive = request()->is('customer/*');
    $orderActive = request()->is('order/*') || request()->is('invoice/*');
    $staffActive = request()->is('staff/*');
    $paymentActive = request()->is('payments*');
    $reportActive = request()->is('report*');
    $settingsActive = request()->is('settings*');
@endphp


<div class="iq-sidebar sidebar-default">

    <div class="iq-sidebar-logo d-flex align-items-center justify-content-between">

        <a href="{{ url('/dashboard') }}" class="header-logo">

            <img src="{{ asset('assets/images/logo.png') }}"
                 class="img-fluid rounded-normal light-logo"
                 alt="logo">

            <h5 class="logo-title light-logo ml-3">
                Z&T Stationary
            </h5>

        </a>

        <div class="iq-menu-bt-sidebar ml-0">
            <i class="las la-bars wrapper-menu"></i>
        </div>

    </div>


    <div class="data-scrollbar" data-scroll="1">

        <nav class="iq-sidebar-menu">

            <ul id="iq-sidebar-toggle" class="iq-menu">


                {{-- =====================================================
                    DASHBOARD
                ====================================================== --}}

                <li class="{{ $dashboardActive ? 'active' : '' }}">

                    <a href="{{ url('/dashboard') }}"
                       class="{{ $dashboardActive ? '' : 'collapsed' }}">

                        <i class="las la-home"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Dashboards
                        </span>

                    </a>

                </li>


                {{-- =====================================================
                    INVENTORY
                ====================================================== --}}

                <li class="{{ $inventoryActive ? 'active' : '' }}">

                    <a href="#inventory"
                       class="{{ $inventoryActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $inventoryActive ? 'true' : 'false' }}">

                        <i class="las la-shopping-cart"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Inventory
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="inventory"
                        class="iq-submenu collapse {{ $inventoryActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('inventory/list') ? 'active' : '' }}">

                            <a href="{{ url('/inventory/list') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    List Inventory
                                </span>

                            </a>

                        </li>


                        <li class="{{ request()->is('inventory/add') ? 'active' : '' }}">

                            <a href="{{ url('/inventory/add') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Add Inventory
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    CATEGORIES
                ====================================================== --}}

                <li class="{{ $categoryActive ? 'active' : '' }}">

                    <a href="#category"
                       class="{{ $categoryActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $categoryActive ? 'true' : 'false' }}">

                        <i class="las la-copy"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Categories
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="category"
                        class="iq-submenu collapse {{ $categoryActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('categories/list') ? 'active' : '' }}">

                            <a href="{{ url('/categories/list') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    List Category
                                </span>

                            </a>

                        </li>


                        <li class="{{ request()->is('categories/add') ? 'active' : '' }}">

                            <a href="{{ url('/categories/add') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Add Category
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    CUSTOMER
                ====================================================== --}}

                <li class="{{ $customerActive ? 'active' : '' }}">

                    <a href="#customer"
                       class="{{ $customerActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $customerActive ? 'true' : 'false' }}">

                        <i class="las la-users"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Customer
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="customer"
                        class="iq-submenu collapse {{ $customerActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('customer/list') ? 'active' : '' }}">

                            <a href="{{ url('/customer/list') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    List Customer
                                </span>

                            </a>

                        </li>


                        <li class="{{ request()->is('customer/add') ? 'active' : '' }}">

                            <a href="{{ url('/customer/add') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Add Customer
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    ORDERS
                ====================================================== --}}

                <li class="{{ $orderActive ? 'active' : '' }}">

                    <a href="#order"
                       class="{{ $orderActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $orderActive ? 'true' : 'false' }}">

                        <i class="las la-shopping-bag"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Orders
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="order"
                        class="iq-submenu collapse {{ $orderActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('order/list') ? 'active' : '' }}">

                            <a href="{{ url('/order/list') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    List Orders
                                </span>

                            </a>

                        </li>


                        <li class="{{ request()->is('order/add') ? 'active' : '' }}">

                            <a href="{{ url('/order/add') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Create Order
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    STAFF
                ====================================================== --}}

                <li class="{{ $staffActive ? 'active' : '' }}">

                    <a href="#staff"
                       class="{{ $staffActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $staffActive ? 'true' : 'false' }}">

                        <i class="las la-user-tie"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Staff
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="staff"
                        class="iq-submenu collapse {{ $staffActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('staff/list') ? 'active' : '' }}">

                            <a href="{{ url('/staff/list') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    List Staff
                                </span>

                            </a>

                        </li>


                        <li class="{{ request()->is('staff/add') ? 'active' : '' }}">

                            <a href="{{ route('staff.add') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Add Staff
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    PAYMENTS
                ====================================================== --}}

                <li class="{{ $paymentActive ? 'active' : '' }}">

                    <a href="#payment"
                       class="{{ $paymentActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $paymentActive ? 'true' : 'false' }}">

                        <i class="las la-credit-card"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Payments
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="payment"
                        class="iq-submenu collapse {{ $paymentActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('payments') ? 'active' : '' }}">

                            <a href="{{ route('payments.index') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    List Payments
                                </span>

                            </a>

                        </li>


                        <li class="{{ request()->is('payments/create') ? 'active' : '' }}">

                            <a href="{{ route('payments.create') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Add Payment
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    REPORT
                ====================================================== --}}

                <li class="{{ $reportActive ? 'active' : '' }}">

                    <a href="#report"
                       class="{{ $reportActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $reportActive ? 'true' : 'false' }}">

                        <i class="las la-chart-bar"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Report
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="report"
                        class="iq-submenu collapse {{ $reportActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('report') ? 'active' : '' }}">

                            <a href="{{ url('/report') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    Report
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


                {{-- =====================================================
                    SETTINGS
                ====================================================== --}}

                <li class="{{ $settingsActive ? 'active' : '' }}">

                    <a href="#settings"
                       class="{{ $settingsActive ? '' : 'collapsed' }}"
                       data-toggle="collapse"
                       aria-expanded="{{ $settingsActive ? 'true' : 'false' }}">

                        <i class="las la-cog"
                           style="font-size:20px;">
                        </i>

                        <span class="ml-4">
                            Settings
                        </span>

                        <i class="las la-angle-down ml-auto"></i>

                    </a>


                    <ul id="settings"
                        class="iq-submenu collapse {{ $settingsActive ? 'show' : '' }}"
                        data-parent="#iq-sidebar-toggle">

                        <li class="{{ request()->is('settings') ? 'active' : '' }}">

                            <a href="{{ url('/settings') }}">

                                <i class="las la-minus"></i>

                                <span>
                                    System Settings
                                </span>

                            </a>

                        </li>

                    </ul>

                </li>


            </ul>

        </nav>

    </div>

</div>