Files
root 2f30a058a4 feat: add full i18n support to Commandocentrum
- Replace all hardcoded Dutch/English strings with __() translation calls
- Update 13 Blade components to use translation keys
- Update Commandocentrum.php controller with translation calls
- Add comprehensive Dutch (nl.json) and English (en.json) translations
- 150+ translation keys for UI labels, messages, and notifications
- Supports all 21 languages available in the lang/ directory
2026-05-19 21:49:39 +02:00

60 lines
3.1 KiB
PHP
Executable File

@props(['activities'])
@php
use App\Models\StaffActivity;
@endphp
@if ($activities->isEmpty())
<div style="text-align:center;padding:40px;color:#9ca3af;">
<svg width="48" height="48" fill="none" stroke="currentColor" viewBox="0 0 24 24" style="margin:0 auto 16px;opacity:0.5;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<p>{{ __('commandocentrum.no_staff_activities') }}</p>
<p style="font-size:12px;margin-top:8px;">{{ __('commandocentrum.staff_actions_auto') }}</p>
</div>
@else
<div style="background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;">
<div style="padding:16px;border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;align-items:center;">
<span style="font-weight:600;color:#1e293b;">{{ __('commandocentrum.recent_staff_activities') }}</span>
<span style="font-size:12px;color:#9ca3af;">{{ __('commandocentrum.last_20_actions') }}</span>
</div>
<div style="max-height:400px;overflow-y:auto;">
@foreach ($activities as $activity)
@php
$icon = StaffActivity::getActionIcon($activity->action);
$timeAgo = '';
try {
$carbon = \Carbon\Carbon::parse($activity->created_at);
$now = \Carbon\Carbon::now();
$diff = $now->diffInMinutes($carbon);
if ($diff < 1) {
$timeAgo = __('commandocentrum.just_now');
} elseif ($diff < 60) {
$timeAgo = $diff . __('commandocentrum.minutes_ago');
} elseif ($diff < 1440) {
$timeAgo = floor($diff / 60) . __('commandocentrum.hours_ago');
} else {
$timeAgo = floor($diff / 1440) . __('commandocentrum.days_ago');
}
} catch (\Exception) {
$timeAgo = __('commandocentrum.unknown');
}
$username = $activity->user->username ?? __('commandocentrum.unknown');
@endphp
<div style="display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid #e2e8f0;">
<div style="width:36px;height:36px;border-radius:50%;background:#f1f5f9;display:flex;align-items:center;justify-content:center;font-size:18px;">
{{ $icon }}
</div>
<div style="flex:1;">
<div style="font-weight:600;color:#1e293b;font-size:14px;">{{ e($username) }}</div>
<div style="color:#64748b;font-size:12px;">{{ e($activity->description) }}</div>
</div>
<div style="text-align:right;">
<span style="font-size:11px;color:#9ca3af;">{{ $timeAgo }}</span>
</div>
</div>
@endforeach
</div>
</div>
@endif