<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">
                <a href="{{ route('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;"></i>
                    {{ $_kategoria->nazov }}
                </a>
                @can('edit')
                    <a href="{{ route('kategoria.edit', ['kategoriaId' => $_kategoria->getKey()]) }}" class="btn btn-md p-0 text-green d-inline-flex">
                        <i class="fa fa-pen"></i>
                    </a>
                    <form action="{{ route('kategoria.destroy', ['kategoriaId' => $_kategoria->getKey()]) }}" method="post" class="d-inline d-inline-flex" onsubmit="return confirm('Prajete si odstrániť kategóriu?')">
                        @method('delete')
                        @csrf
                        <button class="btn btn-md p-0 text-red bg-transparent" type="submit"><i class="fa fa-trash-alt"></i></button>
                    </form>
                @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('kategoria.create') }}" class="btn btn-block btn-outline-primary">Vytvoriť kategóriu</a>
    </div>
    @endcan
</div>