46 lines
2.1 KiB
PHP
Executable File
46 lines
2.1 KiB
PHP
Executable File
@php
|
|
$photos = is_array($photos ?? null) ? $photos : [];
|
|
$primary = $photos[0] ?? null;
|
|
@endphp
|
|
|
|
<div class="space-y-4">
|
|
<div class="flex flex-wrap items-start justify-between gap-3">
|
|
<div>
|
|
<div class="text-sm font-semibold text-slate-900">{{ $assigned ?? 'Contatore' }}</div>
|
|
<div class="text-xs text-slate-500">
|
|
Riga #{{ (int) ($record->id ?? 0) }}
|
|
@if(! empty($record->periodo_dal) || ! empty($record->periodo_al))
|
|
· Periodo {{ optional($record->periodo_dal)->format('d/m/Y') ?: '—' }} → {{ optional($record->periodo_al)->format('d/m/Y') ?: '—' }}
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@if(is_string($mapUrl ?? null) && $mapUrl !== '')
|
|
<a href="{{ $mapUrl }}" target="_blank" rel="noreferrer" class="inline-flex items-center rounded-md bg-slate-800 px-3 py-2 text-xs font-medium text-white hover:bg-slate-700">
|
|
Apri mappa
|
|
</a>
|
|
@endif
|
|
</div>
|
|
|
|
@if($primary)
|
|
<div class="overflow-hidden rounded-xl border border-slate-200 bg-slate-50">
|
|
<img src="{{ $primary['url'] }}" alt="{{ $primary['name'] }}" class="max-h-[60vh] w-full object-contain bg-white" />
|
|
</div>
|
|
@endif
|
|
|
|
@if(count($photos) > 1)
|
|
<div class="grid grid-cols-2 gap-3 md:grid-cols-4">
|
|
@foreach($photos as $photo)
|
|
<a href="{{ $photo['url'] }}" target="_blank" rel="noreferrer" class="overflow-hidden rounded-lg border border-slate-200 bg-white transition hover:border-slate-400">
|
|
<img src="{{ $photo['url'] }}" alt="{{ $photo['name'] }}" class="h-28 w-full object-cover" />
|
|
<div class="border-t border-slate-100 px-2 py-2 text-[11px] text-slate-600">{{ $photo['name'] }}</div>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
@if($photos === [])
|
|
<div class="rounded-lg border border-dashed border-slate-300 bg-slate-50 px-4 py-6 text-sm text-slate-500">
|
|
Nessuna foto disponibile per questa lettura.
|
|
</div>
|
|
@endif
|
|
</div> |