@php
    use App\Support\Diff\DiffRow;
    use App\Support\Diff\DiffRowStatus;

    $row = $row ?? null;
    $compact = (bool) ($compact ?? false);
    $dimUnchanged = (bool) ($dimUnchanged ?? true);

    $partial = $row instanceof DiffRow
        ? match ($row->status) {
            DiffRowStatus::Changed => 'filament.partials.diff.row-changed',
            DiffRowStatus::Added => 'filament.partials.diff.row-added',
            DiffRowStatus::Removed => 'filament.partials.diff.row-removed',
            DiffRowStatus::Unchanged => 'filament.partials.diff.row-unchanged',
        }
        : null;
@endphp

@if (is_string($partial))
    @include($partial, [
        'row' => $row,
        'compact' => $compact,
        'dimUnchanged' => $dimUnchanged,
    ])
@endif
