share-lt/resources/views/components/featured-image-display.blade.php
jon brookes 93c977d1f5 added fixes: warning
some files likely wont be needed and wer added by ai to fix things that were no longer needed !!!
2026-01-03 17:26:18 +00:00

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>