@if(empty($media) || count($media) == 0 )
    <div class="col-span-4">
        <p class="font-regular mt-1 text-gray-600 text-sm">
        @if(isset($no_message))
            {{ $no_message }}
        @else
            No images found in this folder
        @endif
        </p>
    </div>
@else
    @foreach($media as $img)
        @php
            $dims = $img->getBestDims();
         @endphp
        <x-bs-media.item 
            name="{{ basename(@$img->bestPath()) }}"
            thumbnail="{{ $img->thumbnailUrl() }}"
            type="image"
            data-media-id="{{ $img->id}}"
            data-media-filename="{{ basename($img->bestPath()) }}" 
            data-media-width="{{ @$dims['0'] }}" 
            data-media-height="{{ @$dims['1'] }}"
        />
    @endforeach
@endif