some files likely wont be needed and wer added by ai to fix things that were no longer needed !!!
32 lines
1.2 KiB
PHP
32 lines
1.2 KiB
PHP
<div>
|
|
@php
|
|
$record = $this->data;
|
|
if ($record && isset($record['id'])) {
|
|
$entry = \App\Models\Entry::find($record['id']);
|
|
$media = $entry ? $entry->getMedia('featured-image') : [];
|
|
} else {
|
|
$media = [];
|
|
}
|
|
@endphp
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-sm font-medium text-gray-700">Featured Image</label>
|
|
@if(count($media) > 0)
|
|
<div class="space-y-2">
|
|
@foreach($media as $item)
|
|
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-200">
|
|
<div class="flex items-center gap-3">
|
|
<img src="{{ $item->getUrl() }}" alt="" class="w-16 h-16 object-cover rounded">
|
|
<div>
|
|
<p class="text-sm font-medium">{{ $item->name }}</p>
|
|
<p class="text-xs text-gray-500">{{ $item->file_name }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@else
|
|
<p class="text-sm text-gray-500">No featured image selected</p>
|
|
@endif
|
|
</div>
|
|
</div>
|