@php $misJustificaciones = $tarea->justificaciones->where('user_id', auth()->id()); @endphp @if ($misJustificaciones->count() > 0)
@foreach ($misJustificaciones as $justificacion)

{{ Str::limit($justificacion->motivo, 60) }}

@php $justificacionColors = [ 'sin_revisar' => 'bg-yellow-100 text-yellow-800', 'revisada' => 'bg-green-100 text-green-800', ]; $justificacionClass = $justificacionColors[$justificacion->estado] ?? 'bg-gray-100 text-gray-800'; $estadoText = $justificacion->estado === 'sin_revisar' ? 'Pendiente' : 'Revisada'; @endphp {{ $estadoText }}

{{ \Carbon\Carbon::parse($justificacion->fecha_justificacion)->timezone('America/Lima')->format('d/m/Y H:i') }}

@if ($justificacion->evidencia)
@php $filePath = $justificacion->evidencia; if (str_contains($filePath, 'http')) { $filePath = parse_url($filePath, PHP_URL_PATH); $filePath = ltrim($filePath, '/'); } @endphp
{{ basename($filePath) }}
@endif @if ($justificacion->estado === 'revisada' && $justificacion->observacion_admin)

Observación del Admin:

{{ $justificacion->observacion_admin }}

@endif
@endforeach
@else

No hay justificaciones registradas

@if (in_array($tarea->estado, ['pendiente', 'reabierto', 'en_revision'])) @endif
@endif