@props([ 'rows' => [], 'caption' => null, 'emptyMessage' => 'Standings unavailable.', ]) @php $rows = is_array($rows) ? array_values($rows) : []; $formatNumeric = static function ($value) { if (is_numeric($value)) { return (string) (int) $value; } if (is_string($value) && trim($value) !== '') { return trim($value); } return '—'; }; $formatGoalDiff = static function ($value) use ($formatNumeric) { if (is_numeric($value)) { $int = (int) $value; return $int > 0 ? '+' . $int : (string) $int; } return $formatNumeric($value); }; $formatPoints = static function ($value) use ($formatNumeric) { $points = $formatNumeric($value); return $points === '—' ? $points : $points . ' pts'; }; @endphp