@if(count($announcements) > 0) @php $onIndexPage = Route::currentRouteName() === 'announcements.index'; $displayedAnnouncements = $onIndexPage ? $announcements : $announcements->take(3); @endphp
{{-- Header Section --}}

{{ __('Announcements') }}

Stay updated with our latest news and updates

{{-- Announcements Grid --}}
@foreach($displayedAnnouncements as $index => $announcement) @php $publishedAt = $announcement->published_at ?? $announcement->created_at; $isNew = $publishedAt && $publishedAt->gt(now()->subDays(7)); @endphp
{{-- Card Header --}}
@if($isNew)
New
@else
{{ $publishedAt?->format('M d, Y') }}
@endif

{{ $announcement->title }}

{{ $announcement->description }}
{{-- Card Footer --}}
{{ $announcement->created_at->format('M d, Y') }}
{{ __('general.view') }}
{{-- Hover Effect Overlay --}}
@endforeach
@if(!$onIndexPage)
{{ __('View More Announcements') }}
@endif
@endif