@php use App\Models\RefundRequest; $canDecide = (bool) ( $availableActions['can_decide'] ?? false ); $statusDetails = match (true) { (bool) $refund->is_completed => [ 'label' => __('Completed'), 'class' => 'bg-success', 'icon' => 'fa-check-circle', 'description' => __('This refund has been completed.'), ], (int) $refund->status === RefundRequest::STATUS_ACCEPTED => [ 'label' => __('Accepted'), 'class' => 'bg-info', 'icon' => 'fa-thumbs-up', 'description' => __( 'This refund was accepted and is awaiting completion.' ), ], (int) $refund->status === RefundRequest::STATUS_DECLINED => [ 'label' => __('Declined'), 'class' => 'bg-danger', 'icon' => 'fa-times-circle', 'description' => __('This refund request was declined.'), ], default => [ 'label' => __('Pending'), 'class' => 'bg-warning text-dark', 'icon' => 'fa-clock', 'description' => __( 'This refund request is waiting for a decision.' ), ], }; @endphp @if($canDecide)
{{-- Accept Refund --}}
{{ __('Accept Refund') }}

{{ __('Approve this refund request so the financial refund can be completed.') }}

@csrf
@if(old('decision') === 'accept') @error('reason')
{{ $message }}
@enderror @endif
{{-- Decline Refund --}}
{{ __('Decline Refund') }}

{{ __('Reject this refund request. The buyer will be able to see the decision.') }}

@csrf
@if(old('decision') === 'decline') @error('reason')
{{ $message }}
@enderror @endif {{ __('A clear explanation helps the buyer understand the decision.') }}
@else {{-- Decision Already Made --}}
{{ __('Decision Already Made') }}

{{ $statusDetails['description'] }}

{{ $statusDetails['label'] }} @if($refund->refund_reference)
{{ __('Refund reference:') }} {{ $refund->refund_reference }}
@endif @if($refund->completed_at)
{{ __('Completed:') }} {{ $refund->completed_at->format('M d, Y H:i') }}
@endif
@endif @push('styles') @endpush @push('scripts') @endpush