-@extends('backend.dashboard')

@section('content')
<div class="container-fluid">
    <div class="row justify-content-center">
        <div class="col-md-8">

            <div class="card shadow-sm">
                <!-- Card Header -->
                <div class="card-header bg-primary text-white d-flex justify-content-center">
                    <h3 class="card-title mb-0">Inspirational Details</h3>
                </div>

                <div class="card-body">

                    <table class="table table-bordered">
                        <!-- Image Row -->
                        <tr>
                            <th width="30%">Image</th>
                            <td>
                                @if($latestArticle->image)
                                    <img src="{{ asset($latestArticle->image) }}" width="100" alt="latestArticle Image">
                                @else
                                    <span class="text-muted">No Image</span>
                                @endif
                            </td>
                        </tr>

                        <!-- Name -->
                        <tr>
                            <th width="30%">Alt Text</th>
                            <td>{{ $latestArticle->alt_text ?? '—' }}</td>
                        </tr>

                        <!-- Description -->
                        <tr>
                            <th>Title</th>
                            <td>{{ $latestArticle->title ?? '—' }}</td>
                        </tr>


                        <tr>
                            <th>Date</th>
                            <td>{{ $latestArticle->date ?? '—' }}</td>
                        </tr>

                        <tr>
                            <th>Category</th>
                            <td>{{ $latestArticle->category->title ?? '—' }}</td>
                        </tr>

                     <tr>
                            <th>Book Link</th>
                            <td>{{ $latestArticle->amazon_link ?? '—' }}</td>
                        </tr>



                        <!-- Status -->
                        <tr>
                            <th>Status</th>
                            <td>
                                @if($latestArticle->status == 1)
                                    <span class="badge bg-primary">Active</span>
                                @else
                                    <span class="badge bg-danger">De-Active</span>
                                @endif
                            </td>
                        </tr>

                        <!-- Priority -->
                        <tr>
                            <th>Priority</th>
                            <td>{{ $latestArticle->priority ?? '—' }}</td>
                        </tr>
                    </table>

                </div>

                <!-- Card Footer -->
                <div class="card-footer text-end">
                    <a href="{{ route('latest-articles.index') }}" class="btn btn-primary">
                        <i class="fa fa-arrow-left"></i> Back
                    </a>
                </div>
            </div>

        </div>
    </div>
</div>
@endsection
