@props([ 'industries' => null, ]) @php $industries = $industries ?? \App\Support\CategoryNavigation::items(8) ->map(fn (array $category): array => [ 'name' => $category['label'], 'count' => 0, 'delta' => 0, 'href' => $category['href'], ]) ->all(); $maxCount = max(1, collect($industries)->max('count')); $industries = array_slice($industries, 0, 8); @endphp

Branchen-Index

Letzte 7 Tage

@foreach ($industries as $idx => $industry) @php $delta = (int) ($industry['delta'] ?? 0); $direction = $delta > 0 ? 'gain' : ($delta < 0 ? 'loss' : 'flat'); $percent = max(20, (int) round(($industry['count'] ?? 0) / $maxCount * 100)); $isTopRow = $idx < 4; $isLastInRow = ($idx + 1) % 4 === 0; $barClass = $delta < 0 ? 'bg-brand' : 'bg-gain'; @endphp
{{ $industry['name'] }} @if ($delta > 0) +{{ $delta }} @elseif ($delta < 0) {{ $delta }} @else ±0 @endif
{{ $industry['count'] }} Meldungen
@endforeach