mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
63 lines
2.9 KiB
PHP
63 lines
2.9 KiB
PHP
@php
|
|
use Carbon\Carbon;
|
|
$messageList = collect($messages)->reverse()->values();
|
|
@endphp
|
|
<div>
|
|
<x-filament::section
|
|
class="my-6"
|
|
collapsible
|
|
:collapsed="! empty($complete)"
|
|
>
|
|
@foreach($messageList as $idx => $log)
|
|
@if ($idx === 0)
|
|
<x-slot name="icon">
|
|
@if($complete)
|
|
<x-filament::icon icon="heroicon-o-check-circle" class="h-6 w-6 text-success-500 -ml-1"/>
|
|
@else
|
|
<x-filament::loading-indicator class="h-6 w-6 -ml-1"/>
|
|
@endif
|
|
</x-slot>
|
|
|
|
<x-slot name="heading">
|
|
<div class="flex flex-col md:flex-row md:items-start gap-2 -ml-1">
|
|
|
|
<div class="flex-1">
|
|
<div class="font-bold">{{ str()->of($log['message'])->limit() }}</div>
|
|
<div
|
|
class="fi-section-header-description overflow-hidden break-words text-sm text-gray-500 dark:text-gray-400 mt-1">
|
|
@if(isset($log['data']['subtitle']))
|
|
<a class="font-normal break-all" href="{{ $log['data']['subtitle'] }}"
|
|
target="_blank">
|
|
{{ str()->of(data_get($log, 'data.subtitle', ''))->limit() }}
|
|
</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-slot>
|
|
@else
|
|
@php
|
|
$previousTimestamp = $messageList[$idx - 1]['timestamp'] ?? null;
|
|
$duration = $previousTimestamp && isset($log['timestamp'])
|
|
? Carbon::parse($log['timestamp'])->diffInSeconds($previousTimestamp).' sec'
|
|
: null;
|
|
$icon = data_get($log, 'data.icon', 'heroicon-o-check-circle');
|
|
@endphp
|
|
<div
|
|
class="text-sm text-gray-500 dark:text-gray-300 flex md:items-center py-3 md:py-1 border-t border-gray-300 dark:border-gray-800 first:border-t-0">
|
|
<x-filament::icon icon="{{ $icon }}" class="w-5 h-5 min-w-4 mr-2"/>
|
|
<div class="flex flex-col md:flex-row md:justify-between gap-2 flex-1">
|
|
<div class="md:flex-1">{{ str()->of($log['message'])->limit() }}</div>
|
|
@if(isset($log['timestamp']))
|
|
<div class="md:ml-auto text-xs font-normal text-gray-400 dark:text-gray-400">
|
|
{{ $duration }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
</div>
|
|
@endif
|
|
@endforeach
|
|
</x-filament::section>
|
|
</div>
|