@csrf
<div class="row g-3">
    <div class="col-md-8"><label class="form-label">Title <span class="text-danger">*</span></label>
        <input type="text" name="title" value="{{ old('title', $notice->title) }}" class="form-control @error('title') is-invalid @enderror" required>
        @error('title')<div class="invalid-feedback">{{ $message }}</div>@enderror</div>
    <div class="col-md-2"><label class="form-label">Audience</label>
        <select name="audience" class="form-select text-capitalize">
            @foreach(App\Models\Notice::AUDIENCES as $a)<option value="{{ $a }}" @selected(old('audience',$notice->audience)===$a)>{{ $a }}</option>@endforeach
        </select></div>
    <div class="col-md-2"><label class="form-label">Publish Date</label>
        <input type="date" name="published_at" value="{{ old('published_at', optional($notice->published_at)->format('Y-m-d') ?? now()->format('Y-m-d')) }}" class="form-control"></div>
    <div class="col-12"><label class="form-label">Body <span class="text-danger">*</span></label>
        <textarea name="body" rows="6" class="form-control @error('body') is-invalid @enderror" required>{{ old('body', $notice->body) }}</textarea>
        @error('body')<div class="invalid-feedback">{{ $message }}</div>@enderror</div>
    <div class="col-12"><div class="form-check"><input type="checkbox" name="is_published" value="1" id="is_published" class="form-check-input" @checked(old('is_published', $notice->is_published ?? true))><label for="is_published" class="form-check-label">Published (visible to audience)</label></div></div>
</div>
<div class="mt-3 d-flex gap-2">
    <button class="btn btn-primary"><i class="bi bi-check-lg me-1"></i>{{ $submitLabel ?? 'Save' }}</button>
    <a href="{{ route('notices.index') }}" class="btn btn-light border">Cancel</a>
</div>
