@forelse($orders as $o)
@php
$currency = $o->wallet->currency->code;
$decimals = (int) setting('site_decimal', 2);
$actorId = (int) auth()->id();
$hasFeedback = $o->relationLoaded('feedbacks')
? $o->feedbacks->where('user_id', $actorId)->isNotEmpty()
: false;
$canRate = $o->status->value === 'COMPLETED' && $actorId === (int) $o->taker_id && ! $hasFeedback;
@endphp
#{{ $o->id }} · {{ $currency }}
{{ $o->offer->side->label() }}
{{ $o->status->label() }}
@lang('Price'): {{ number_format((float) $o->price, $decimals) }}
@lang('Amount'): {{ number_format((float) $o->amount, $decimals) }}
@lang('View')
@if($canRate)
@elseif($o->status->value === 'COMPLETED' && $hasFeedback)
@php
$myFb = $o->feedbacks->where('user_id', $actorId)->first();
@endphp
@if($myFb)
{{ (int) $myFb->rating }}/5
@endif
@endif
@empty
@endforelse