@props([ 'diff' => null, 'compact' => true, ]) @php $changes = collect(data_get($diff, 'changes', []))->values(); @endphp @if ($changes->isNotEmpty())
$compact, 'space-y-5' => ! $compact])> @foreach ($changes->groupBy('section_label') as $sectionLabel => $sectionChanges)

$compact, 'mb-2 text-[11px]' => ! $compact, ])> {{ $sectionLabel }}

$compact, 'gap-3 px-3 py-2' => ! $compact, ])>
Field
Current
New
@foreach ($sectionChanges as $change) @php $changeKey = (string) data_get($change, 'key'); $expandable = data_get($change, 'expandable', false); $oldDisplay = (string) data_get($change, 'old_display_value'); $newDisplay = (string) data_get($change, 'new_display_value'); $oldFull = data_get($change, 'old_full_value') ?? $oldDisplay; $newFull = data_get($change, 'new_full_value') ?? $newDisplay; $label = (string) data_get($change, 'label'); $labelTruncated = mb_strlen($label) > 24; $rowExpandable = $expandable || $labelTruncated; @endphp
$compact, 'gap-3 px-3 py-2.5 text-sm' => ! $compact, ])>
@if ($rowExpandable)
@else {{ $label }} @endif
@if ($expandable)
@else
{{ $oldDisplay }}
@endif
@if ($expandable)
@else
{{ $newDisplay }}
@endif
@if ($rowExpandable) @endif
@endforeach
@endforeach
@endif