<?php $__env->startSection('section'); ?>
<style>
        img {
            object-fit: contain !important;
            width: 400px;
            height: 200px;
        }

         .overflow-column {
             max-width: 700px; /* Set a maximum width for the column */
         }

        .overflow-content {
            overflow: hidden  !important;
            white-space: nowrap !important;
            text-overflow: ellipsis !important;
            width: 700px !important;
        }

    </style>

    <div class="content-wrapper">
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>Post Listing</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="<?php echo e(url('admin/dashboard')); ?>">Home</a></li>
                            <li class="breadcrumb-item active">Posts</li>
                        </ol>
                    </div>
                </div>
            </div>
        </section>

        <section class="content">
            <div class="container-fluid">
                <div class="row">

                    <div class="col-12">
                        <table id="ordertable" class="table table-bordered dt-responsive nowrap"
                               style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                            <thead>
                            <tr>
                                <th>User</th>
                                <th >Category</th>
                                <th class="overflow-column">Content</th>
                                <th>Created At</th>
                                <th>Actions</th>
                            </tr>
                            </thead>
                        </table>
                    </div>

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

<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>

        $(document).ready(function () {
            $('#ordertable').DataTable({
                ordering: false,
                processing: true,
                serverSide: true,
                ajax: {
                    url: '<?php echo e(route('admin.post.index')); ?>',
                    data: function (data) {
                    }
                },
                columns: [
                    {data: 'user_name', name: 'user_name'},
                    {data: 'category_name', name: 'category_name'},
                    {
                        data: 'post_content',
                        name: 'post_content',
                        render: function (data, type, row) {
                            // You can customize the content here
                            return '<div class="overflow-content">' + data + '</div>';
                        }
                    },

                    {data: 'created_at', name: 'created_at'},
                    {data: 'action', name: 'action', orderable: false, searchable: false}
                ]
            });
        });


    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/servicedemoweb/public_html/global-man-cave/resources/views/admin/posts/index.blade.php ENDPATH**/ ?>