@php use Seka\Portal\Modul\Terminy\Entities\Udalost\DruhUdalosti;use Seka\Portal\Modul\Terminy\Notifications\Udalost\AktualizovanaUdalostNotifikaciaDB;use Seka\Portal\Modul\Terminy\Notifications\Udalost\ZrusenaUdalostNotifikaciaDB;use Seka\Portal\Modul\Terminy\Notifications\Udalost\ZverejnenaNovaUdalostNotifikaciaDB; @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(ZverejnenaNovaUdalostNotifikaciaDB::class)
                                Bola zverejnená nová udalosť <strong>{{ $notification->data['nazov'] }}</strong>
                                @break
                            @case(AktualizovanaUdalostNotifikaciaDB::class)
                                Udalosť <strong>{{ $notification->data['nazov'] }}</strong> bola aktualizovaná
                                @break
                            @case(ZrusenaUdalostNotifikaciaDB::class)
                                Udalosť <strong>{{ $notification->data['nazov'] }}</strong> bola zrušená
                                @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['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>
