@props([ 'title' => '', 'headline' => '', 'subheadline' => null, 'rows' => [], ]) @php $rows = collect($rows) ->map(fn ($row) => [ 'label' => (string) ($row['label'] ?? ''), 'value' => (int) ($row['value'] ?? 0), 'bar_class' => (string) ($row['bar_class'] ?? 'bg-red-600'), ]) ->all(); $maxValue = (int) collect($rows)->max('value'); // Inflate scale so the top value does not span the full track; ratios between rows stay the same. $scaleMax = $maxValue > 0 ? max((int) ceil($maxValue * 3), $maxValue + 12, 20) : 1; @endphp
{{ $title }}
{{ $headline }}
@if ($subheadline !== null && $subheadline !== ''){{ $subheadline }}
@endif