<ul class="app-menu">
    <li><a class="app-menu__item {{ Route::currentRouteName() == 'home' ? 'active' : '' }}" href="{{route('home')}}"><i
                class="app-menu__icon bi bi-speedometer"></i><span
                class="app-menu__label">{{__('lang.dashboard')}}</span></a>
    </li>
    @canany(['books.create', 'books.read', 'books.edit'])
    <li><a class="app-menu__item {{ Str::startsWith(Route::currentRouteName(), 'books.') ? 'active' : '' }}"
            href="{{route('books.index')}}"><i class="app-menu__icon bi bi-book-half"></i><span
                class="app-menu__label">{{__('lang.books')}}</span></a>
    </li>
    @endcanany
    @canany(['members.create', 'members.read', 'members.edit'])
    <li><a class="app-menu__item {{ Str::startsWith(Route::currentRouteName(), 'members.') ? 'active' : '' }}"
            href="{{route('members.index')}}"><i class="app-menu__icon bi bi-people"></i><span
                class="app-menu__label">{{__('lang.members')}}</span></a>
    </li>
    @endcanany
    @canany(['borrows.create', 'borrows.read', 'borrows.edit'])
    <li><a class="app-menu__item {{ Str::startsWith(Route::currentRouteName(), 'borrows.') ? 'active' : '' }}"
            href="{{route('borrows.index')}}"><i class="app-menu__icon bi bi-person-vcard"></i><span
                class="app-menu__label">{{__('lang.borrows')}}</span></a>
    </li>
    @endcanany
    @canany(['wastes.create', 'wastes.read', 'wastes.edit'])
    <li><a class="app-menu__item {{ Str::startsWith(Route::currentRouteName(), 'wastes.') ? 'active' : '' }}"
            href="{{route('wastes.index')}}"><i class="app-menu__icon bi bi-trash"></i><span
                class="app-menu__label">{{__('lang.wastes')}}</span></a>
    </li>
    @endcanany
    @canany(['categories.create', 'categories.read', 'categories.edit',
    'languages.create', 'languages.read', 'languages.edit',
    'locations.create', 'locations.read', 'locations.edit',
    ])

    <li class="treeview {{ Str::contains(url()->current(), 'settings') ? 'is-expanded' : '' }}"><a
            class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon bi bi-gear"></i><span
                class="app-menu__label">{{__('lang.setting')}}</span><i
                class="treeview-indicator bi bi-chevron-right"></i></a>
        <ul class="treeview-menu">
            @canany(['categories.create', 'categories.read', 'categories.edit'])
            <li>
                <a class="treeview-item  {{ Str::startsWith(Route::currentRouteName(), 'categories.') ? 'active' : '' }}"
                    href="{{route('categories.index')}}"><i
                        class="icon bi bi-arrow-return-{{(app()->getLocale()=='en')?'right':'left'}}"></i>
                    {{__('lang.categories')}}
                </a>
            </li>
            @endcanany
            @canany(['languages.create', 'languages.read', 'languages.edit'])
            <li>
                <a class="treeview-item  {{ Str::startsWith(Route::currentRouteName(), 'languages.') ? 'active' : '' }}"
                    href="{{route('languages.index')}}"><i
                        class="icon bi bi-arrow-return-{{(app()->getLocale()=='en')?'right':'left'}}"></i>
                    {{__('lang.languages')}}
                </a>
            </li>
            @endcanany
            @canany(['locations.create', 'locations.read', 'locations.edit'])
            <li>
                <a class="treeview-item  {{ Str::startsWith(Route::currentRouteName(), 'locations.') ? 'active' : '' }}"
                    href="{{route('locations.index')}}"><i
                        class="icon bi bi-arrow-return-{{(app()->getLocale()=='en')?'right':'left'}}"></i>
                    {{__('lang.locations')}}
                </a>
            </li>
            @endcanany
        </ul>
    </li>
    @endcanany
</ul>