@php $statusChip = ['published' => 'bg-green-500/15 text-green-400', 'draft' => 'bg-slate-500/15 text-slate-400']; @endphp
@if ($editingId === null) {{-- ===================== LIST ===================== --}}
@foreach (['all' => 'All', 'published' => 'Published', 'draft' => 'Drafts'] as $key => $label) @endforeach
@if ($rows->count())
@foreach ($rows as $a)
@if ($a->coverUrl()) @else @endif
{{ $a->title }} {{ ucfirst($a->status) }}
/blog/{{ $a->slug }} @if ($a->category)·{{ $a->category->name }}@endif ·{{ $a->published_at?->format('M j, Y') ?? 'no date' }} ·{{ number_format($a->views) }} views
@if ($a->isLive()) @endif
@endforeach
@if ($rows->hasPages())
{{ $rows->links('pagination.dark') }}
@endif @else

No articles yet

Write your first article to start your blog.

@endif
@else {{-- ===================== EDITOR ===================== --}}

{{ $editingId ? 'Edit Article' : 'New Article' }}

{{-- Main: title + markdown + live preview --}}
@error('title')

{{ $message }}

@enderror
URL:/blog/
@error('slug')

{{ $message }}

@enderror
**bold** · # heading · - list · [link](url) · ![alt](image)
Live preview
{!! $this->previewHtml ?: '

Preview appears as you type…

' !!}
@error('body')

{{ $message }}

@enderror
{{-- Sidebar: publish + cover + category + excerpt + SEO --}}

Publish

Cover image

@if ($cover) @elseif ($existingCover && ! $removeCover) @endif
Uploading…
@error('cover')

{{ $message }}

@enderror

Category

Excerpt & SEO

@endif