@extends('layouts.parent')
@section('title', 'Notices')
@section('page_title', 'Notice Board')

@section('content')
    <div class="row g-3">
        @forelse($notices as $notice)
            <div class="col-12">
                <div class="card"><div class="card-body">
                    <div class="d-flex justify-content-between align-items-start">
                        <h6 class="mb-1"><i class="bi bi-megaphone text-primary me-1"></i>{{ $notice->title }}</h6>
                        <span class="small text-muted">{{ optional($notice->published_at)->format('d M Y') }}</span>
                    </div>
                    <p class="mb-0 small text-muted" style="white-space:pre-line">{{ $notice->body }}</p>
                </div></div>
            </div>
        @empty
            <div class="col-12"><div class="card"><div class="card-body text-center text-muted py-4">No notices at the moment.</div></div></div>
        @endforelse
    </div>
    <div class="mt-3">{{ $notices->links() }}</div>
@endsection
