Files
analytics/resources/views/reports/audience/language.blade.php
T
2026-03-18 13:32:36 +02:00

26 lines
1.3 KiB
PHP

<x-report-layout :website="$website" :from="$from" :to="$to" title="Language Report">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
<h3 class="text-base font-semibold text-gray-900 mb-4">Visitors by Language</h3>
@if ($languages->isNotEmpty())
@php $total = $languages->sum('visitors'); @endphp
<div class="space-y-3">
@foreach ($languages as $row)
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-gray-900">{{ $row->language }}</span>
<span class="text-gray-500">{{ number_format($row->visitors) }} ({{ $total > 0 ? round(($row->visitors / $total) * 100, 1) : 0 }}%)</span>
</div>
<div class="w-full bg-gray-100 rounded-full h-2">
<div class="bg-indigo-500 h-2 rounded-full" style="width: {{ $total > 0 ? ($row->visitors / $total) * 100 : 0 }}%"></div>
</div>
</div>
@endforeach
</div>
@else
<p class="text-sm text-gray-500 py-8 text-center">No language data available for this period.</p>
@endif
</div>
</x-report-layout>