@push('css') @endpush @php function getNewsTypeColor($type) { $colors = [ 'general' => 'secondary', 'security_alert' => 'danger', 'market_trend' => 'success', 'claims_update' => 'info', 'legal_update' => 'warning', 'technical_update' => 'primary', 'guidance' => 'dark', 'event' => 'purple' ]; return $colors[$type] ?? 'secondary'; } function truncateText($text, $length) { if (strlen($text) <= $length) return $text; return substr($text, 0, $length) . '...'; } @endphp

{{ __('labels.latest_news') }}

@if(isset($news['count']) && $news['count']) {{ $news['count'] ?? '' }} {{ __('labels.news') }} @endif
@forelse($news['list'] as $index => $item)
{{-- {{ ucfirst(str_replace('_', ' ', $item['type'])) }} --}} {{ __('labels.new_types.' . $item['type']) }} {{ date('M d, h:i A', strtotime($item['published_at'])) }}
@if($item['is_locked']) @endif @if($item['is_approved']) @endif {{ htmlspecialchars($item['title']) }}

{{ truncateText(strip_tags($item['description']), 80) }}

{{-- {{ ucfirst($item['status']) }} --}}
@empty

{{ __('labels.no_news_available') }}

@endforelse
@push('js') @endpush