{{-- Seller score card. $row comes from InsightService::sellerPerformance()/sellerScore(). --}} @props(['row', 'compact' => false, 'period' => 'last 90 days']) @php $s = $row->score; $days = (int) settings('reports.ship_within_days', 2); $metrics = [ ['Shipped on time', $row->late_rate === null ? '–' : (100 - $row->late_rate).'%', $row->late_rate === null ? 'secondary' : ($row->late_rate >= 20 ? 'danger' : ($row->late_rate >= 10 ? 'warning' : 'success')), 'within '.$days.' '.Str::plural('day', $days)], ['Cancelled by you', ($row->cancel_rate ?? 0).'%', ($row->cancel_rate ?? 0) >= 5 ? 'danger' : (($row->cancel_rate ?? 0) >= 2 ? 'warning' : 'success'), $row->seller_cancels.' '.Str::plural('item', $row->seller_cancels)], ['Returned', $row->return_rate === null ? '–' : $row->return_rate.'%', ($row->return_rate ?? 0) >= 10 ? 'danger' : (($row->return_rate ?? 0) >= 5 ? 'warning' : 'success'), $row->returns.' of '.$row->delivered.' delivered'], ['Rating', $row->rating !== null ? $row->rating.' ★' : '–', $row->rating === null ? 'secondary' : ($row->rating < 3.5 ? 'danger' : ($row->rating < 4 ? 'warning' : 'success')), $row->reviews.' '.Str::plural('review', $row->reviews)], ]; @endphp
merge(['class' => 'card seller-score']) }}>
Seller score · {{ $period }}
{{ $s['label'] }}
@if ($row->overdue)
{{ $row->overdue }} {{ Str::plural('order', $row->overdue) }} overdue to ship
@endif
@unless ($compact)
@foreach ($metrics as [$label, $value, $tone, $hint])
{{ $label }}
{{ $value }}
{{ $hint }}
@endforeach
@endunless @if ($s['tips']) @elseif ($s['score'] !== null)

Great work. Keep shipping on time and stock up to date.

@endif