<x-app-layout>
    @section('title')
        Blog View
    @endsection
    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800">
        @can('Blog access')
            <a href="{{ route('admin.blogs.index') }}" class="btn btn-primary"><i class="fas fa-plus" aria-hidden="true"></i>
                Blog Listing
            </a>
        @endcan
    </h1>

    <!-- DataTales Example -->
    <div class="row">
        <div class="col-md-12">
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary">
                        Job Posts Form
                    </h6>
                </div>
                <div class="card-body">

                    <div class="table-responsive">
                        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                            <tr>
                                <th>Title</th>
                                <td>{{ $data->title }}</td>
                            </tr>
                            <tr>
                                <th>Short Description</th>
                                <td>{!! $data->short_description !!}</td>
                            </tr>
                            <tr>
                                <th>Description</th>
                                <td>{!! $data->description !!}</td>
                            </tr>

                            <tr>
                                <th>Category</th>
                                <td>{{ $data->category->name }}</td>
                            </tr>

                            <tr>
                                <th>Tags</th>
                                <td>
                                    <span class="badge badge-success">{{ $data->tags }}</span>
                                </td>
                            </tr>

                            <tr>
                                <th>Image</th>
                                <td>
                                    <img width="130px" height="120pxz" src="{{ asset($data->image) }}" alt="{{ $data->title }}">
                                </td>
                            </tr>

                            <tr>
                                <th>Status</th>
                                <td>
                                    @if ($data->status==1)
                                    <span class="badge badge-success">Active</span></td>
                                    @else
                                    <span class="badge badge-danger">Inactive</span></td>
                                    @endif
                            </tr>
                            <tr>
                                <th>Action</th>
                                <td class="d-flex">
                                    <a href="{{ route('admin.blogs.edit',$data->id) }}" class="btn btn-secondary mr-1">Edit</a>
                                    <a id="delete" href="{{ route('admin.blogs.destroy',$data->id) }}" class="btn btn-danger mr-1">Delete</a>
                                </td>
                            </tr>

                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>

</x-app-layout>
