@php $monthsPt = ['JAN', 'FEV', 'MAR', 'ABR', 'MAI', 'JUN', 'JUL', 'AGO', 'SET', 'OUT', 'NOV', 'DEZ']; $defaultCover = asset('assets/sucesu/img/news-default.jpg'); $title = $data['title'] ?? 'Últimas Notícias'; $super = $data['super_highlighted'] ?? null; $items = $data['items'] ?? []; @endphp @if(!empty($items) || !empty($super)) {{-- TÍTULO DA SEÇÃO --}} {{ $title }} Ver todas {{-- 1. SUPER DESTAQUE --}} @if(!empty($super)) @php $sh = $super; $shDate = !empty($sh['published_at']) ? \Carbon\Carbon::parse($sh['published_at']) : null; $monthName = $shDate ? strtolower($monthsPt[$shDate->format('n') - 1]) : ''; $coverUrl = $sh['cover_image_url'] ?: $defaultCover; @endphp @if(!empty($sh['category_name'])) {{ $sh['category_name'] }} @endif {{ $sh['title'] }} @if(!empty($sh['subtitle'])) {{ $sh['subtitle'] }} @endif @if($shDate) {{ $shDate->format('d') }} de {{ $monthName }} de {{ $shDate->format('Y') }} @endif @if(!empty($sh['responsible_name'])) {{ $sh['responsible_name'] }} @endif Leia Mais @endif {{-- 2. GRID DE NOTÍCIAS --}} @if(!empty($items)) @foreach($items as $item) @php $itemDate = !empty($item['published_at']) ? \Carbon\Carbon::parse($item['published_at']) : null; $itemCover = $item['cover_image_url'] ?: $defaultCover; @endphp @if(!empty($item['category_name'])) {{ $item['category_name'] }} @endif @if($item['is_super_highlighted'] ?? false) @elseif($item['is_highlighted'] ?? false) @endif {{ $item['title'] }} @if(!empty($item['summary'])) {{ str_limit(strip_tags($item['summary']), 120) }} @elseif(!empty($item['subtitle'])) {{ str_limit(strip_tags($item['subtitle']), 120) }} @endif @endforeach @endif @endif
{{ $sh['subtitle'] }}
{{ str_limit(strip_tags($item['summary']), 120) }}
{{ str_limit(strip_tags($item['subtitle']), 120) }}