<div class="m-0 p-0">
    @forelse($udalost->moznosti as $zoznamMoznosti)
        <h5>
            {{$zoznamMoznosti->getNazov()}}
        </h5>
        <form class="d-flex flex-column">
            @forelse($zoznamMoznosti->getMoznosti() as $moznost)
                <div class="custom-control custom-radio">
                    <input class="custom-control-input"
                           type="radio"
                           name="radio"
                           id="moznost_{{$moznost->getId()}}"
                           value="{{$moznost->getId()}}"
                           wire:model.change="moznosti.{{$zoznamMoznosti->getKod()}}">
                    <label class="custom-control-label"
                           for="moznost_{{$moznost->getId()}}">{{$moznost->getPopis()}}</label>
                </div>
            @empty
                <span>Nie sú žiadne možnosti na výber...</span>
            @endforelse
        </form>

        <hr>
    @empty
        <span>Nie sú žiadne možnosti na výber...</span>
    @endforelse

    <div class="row">
        <div class="col text-center">
            <div class="custom-control custom-checkbox mb-2">
                <input type="checkbox"
                       class="custom-control-input"
                       id="accept-options-choices"
                       wire:model.change="acceptChoices">
                <label class="custom-control-label" for="accept-options-choices">potvrdzujem mnou zvolené možnosti
                    registrácie na udalosť</label>
            </div>

            <button class="btn btn-primary" @if(!$this->acceptChoices || !$this->choosedAllOptions) disabled="disabled"
                    @endif wire:click="createRegistration()">
                <span wire:loading.remove
                      wire:target="createRegistration"
                      class="icon-floppy"></span>
                <span wire:loading
                      wire:target="createRegistration"
                      class="spinner-grow spinner-grow-sm"
                      role="status"></span>
                Vytvoriť registráciu
            </button>
        </div>
    </div>
</div>
