{{-- 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
Great work. Keep shipping on time and stock up to date.
@endif