<div class="card card-sm shadow">
    <div class="card-header">
        <span class="h6 title-decorative">Kategórie</span>
    </div>
    <div class="card-body">
        <nav class="nav nav-list flex-md-column">
        @forelse($kategorie as $_kategoria)
            <div class="nav-item d-flex justify-content-between">
                <div>
                    <a href="{{ route('vzdelavanie.kniznica.kategoria.ucebnice.index', ['kategoriaId' => $_kategoria->getKey()]) }}" class="nav-link d-inline-flex @if(isset($kategoria) && $kategoria->getKey() == $_kategoria->getKey()) active @endif">
                        <i class="fa {{ $_kategoria->obrazok }}" style="width: 26px;padding-top: 0.2rem !important;"></i>
                        {{ $_kategoria->nazov }}
                    </a>
                </div>
                @can('vzdelavanie_kniznica')
                    <div class="dropdown">
                        <div class="btn btn-sm btn-outline-primary dropdown-toggle dropdown-toggle-no-arrow" id="SidekickButton" data-toggle="dropdown">
                            <i class="icon-dots-three-horizontal"></i>
                        </div>
                        <div class="dropdown-menu dropdown-menu-sm" aria-labelledby="SidekickButton">
                            <a class="dropdown-item" href="{{ route('vzdelavanie.kniznica.kategoria.edit', ['kategoriaId' => $_kategoria->getKey()]) }}">
                                <i class="fa fa-pen"></i> Upraviť
                            </a>
                            <a class="dropdown-item" href="#" onclick="event.preventDefault();(confirm('Prajete si odstrániť kategóriu?')) ? document.getElementById('form-delete-{{ $_kategoria->getKey() }}').submit() : null;">
                                <i class="fa fa-trash-alt"></i> Odstrániť
                            </a>
                            <form id="form-delete-{{ $_kategoria->getKey() }}" action="{{ route('vzdelavanie.kniznica.kategoria.destroy', ['kategoriaId' => $_kategoria->getKey()]) }}" method="post" class="d-inline d-inline-flex" style="display: none !important;">
                                @method('delete')
                                @csrf
                            </form>
                        </div>
                    </div>
                @endcan
            </div>
        @empty
            <div class="nav-item">
                <h6 class="title-decorative text-center">žiadna kategória</h6>
            </div>
        @endforelse
        </nav>
    </div>
    @can('edit')
    <div class="card-footer">
        <a href="{{ route('vzdelavanie.kniznica.kategoria.create') }}" class="btn btn-block btn-outline-primary">Vytvoriť kategóriu</a>
    </div>
    @endcan
</div>