@props([ 'cards' => [], 'max' => null, ]) @php $chartCards = collect($cards)->values(); $chartMax = max(1, (int) ($max ?? $chartCards->max('count'))); $totalDocuments = (int) $chartCards->sum(fn ($card) => (int) ($card['count'] ?? 0)); @endphp @once @endonce
{{ __('Documents by Type') }} {{ __('Total Documents') }}: {{ number_format($totalDocuments) }}

{{ __('Document counts grouped by document type.') }}

@foreach($chartCards as $card) @php $chartLabel = trim((string) ($card['label'] ?? __('N/A'))); $chartLabel = $chartLabel !== '' ? $chartLabel : __('N/A'); $chartCount = (int) ($card['count'] ?? 0); $barWidth = $chartCount > 0 ? max(3, (int) round(($chartCount / $chartMax) * 100)) : 0; $chartKey = $card['key'] ?? md5(mb_strtolower((string) $chartLabel)); @endphp
{{ $chartLabel }}
{{ $chartCount }}
@endforeach
@once @endonce @include('components.dashboard-filter-summary-script')