<div class="drafts-item">
    <div class="drafts-cover">
        @if($news->gallery()->first())
            <img src="{{ Storage::url($news->gallery()->first()->image) }}">
        @else
            <div class="drafts-cover-placeholder">
                <i data-lucide="image" size="24"></i>
            </div>
        @endif
    </div>

    <div class="drafts-info">
        <div class="drafts-top">
            <div>
                <h3 class="drafts-title">
                    {{ $news->title }}
                </h3>
                <div class="drafts-meta">
                    <span class="badge news">
                        News
                    </span>
                    @if( $news->category_id )
                        <span class="badge">{{ $news->category->name }}</span>
                    @endif
                </div>
            </div>
            <div class="drafts-dates">
                <span>
                    <i data-lucide="pencil" size="12"></i>
                    Last edited {{ $draft->updated_at->diffForHumans() }}
                </span>
                <span>
                    <i data-lucide="calendar" size="12"></i>
                    Created {{ $draft->created_at->format('d M Y') }}
                </span>
            </div>
        </div>

        <div class="drafts-actions">
            <a href="{{ route('news.edit', ['news' => $news]) }}" class="btn primary">
                <i data-lucide="pen" size="13"></i>
                Continue editing
            </a>
            <a href="{{ route('news.show', ['news' => $news] ) }}" class="btn" target="_blank">
                <i data-lucide="eye" size="13"></i>
                Preview
            </a>
        </div>

    </div>
</div>
