Files
analytics/resources/views/reports/audience/language.blade.php
T

26 lines
1.3 KiB
PHP
Raw Normal View History

2026-03-18 13:32:36 +02:00
<x-report-layout :website="$website" :from="$from" :to="$to" title="Language Report">
2026-03-19 18:42:19 +02:00
<div class="bg-white rounded-xl border border-gray-200 overflow-hidden p-6">
2026-03-18 13:32:36 +02:00
<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
2026-03-19 18:42:19 +02:00
<x-empty-state message="No language data available for this period." />
2026-03-18 13:32:36 +02:00
@endif
</div>
</x-report-layout>