@php use Seka\Portal\Modul\Terminy\Entities\Udalost\DruhUdalosti;use Seka\Portal\Modul\Terminy\Notifications\Registracia\VytvorenaRegistraciaNotifikacia;use Seka\Portal\Modul\Terminy\Notifications\Registracia\ZrusenaRegistraciaNotifikacia; @endphp
<a href="#" wire:click.prevent="markAsRead('{{ $notification->id }}', '{{ $url }}')"
   class="list-group-item list-group-item-action">

    <div class="media">
        <div class="avatar">
            <i class="icon-calendar text-indigo display-4"></i>
        </div>

        <div class="media-body">
            <div class="d-flex justify-content-between mb-1">
                <div>
                    <h3 class="h4">
                        @switch($notification->type)
                            @case(VytvorenaRegistraciaNotifikacia::class)
                                Vaša registrácia na <strong>{{ $notification->data['udalost']['nazov'] }} bola
                                    zaevidovaná</strong>
                                @break
                            @case(ZrusenaRegistraciaNotifikacia::class)
                                Vaša registrácia na <strong>{{ $notification->data['udalost']['nazov'] }} bola
                                    zrušená</strong>
                                @break
                            @default
                                ???
                        @endswitch
                    </h3>
                </div>

                <div>
                    <span class="badge badge-indicator @if($notification->read_at) badge-primary @else badge-success @endif"></span>
                </div>
            </div>

            <div class="mb-1">
                <span class="badge badge-light">{{ mb_strtoupper(DruhUdalosti::tryFrom($notification->data['udalost']['druh'])->label()) }}</span>
            </div>

            <div class="d-flex justify-content-between">
                <div class="text-small"></div>
                <div class="text-small">
                    <ul class="list-inline text-muted">
                        <li class="list-inline-item">
                            <span class="icon-calendar"></span>
                            Doručené: {{ $notification->created_at->longRelativeDiffForHumans() }}
                        </li>
                        @if($notification->read_at)
                            <li class="list-inline-item">
                                <span class="icon-calendar"></span>
                                Prečítaná: {{ $notification->read_at->longRelativeDiffForHumans() }}
                            </li>
                        @endif
                    </ul>
                </div>
            </div>
        </div>
    </div>

</a>
