<?php $__env->startSection('header', 'Contact Messages'); ?>
<?php $__env->startSection('content'); ?>
<div class="bg-white rounded shadow overflow-x-auto">
    <table class="w-full whitespace-nowrap">
        <thead>
            <tr class="text-left font-bold bg-gray-50 border-b">
                <th class="px-6 py-3">Date</th>
                <th class="px-6 py-3">Name</th>
                <th class="px-6 py-3">Email</th>
                <th class="px-6 py-3">Status</th>
                <th class="px-6 py-3">Actions</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr class="border-b focus-within:bg-gray-100 hover:bg-gray-100 <?php echo e($message->is_read ? 'text-gray-500' : 'font-semibold'); ?>">
                <td class="px-6 py-4"><?php echo e($message->created_at->format('M d, Y')); ?></td>
                <td class="px-6 py-4"><?php echo e($message->name); ?></td>
                <td class="px-6 py-4"><?php echo e($message->email); ?></td>
                <td class="px-6 py-4">
                    <?php if(!$message->is_read): ?>
                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">Unread</span>
                    <?php else: ?>
                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800">Read</span>
                    <?php endif; ?>
                </td>
                <td class="px-6 py-4 flex space-x-2">
                    <a href="<?php echo e(route('admin.messages.show', $message)); ?>" class="text-teal-600 hover:text-teal-900">View</a>
                    <form action="<?php echo e(route('admin.messages.destroy', $message)); ?>" method="POST" onsubmit="return confirm('Delete this message?');">
                        <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                        <button type="submit" class="text-red-600 hover:text-red-900">Delete</button>
                    </form>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr>
                <td colspan="5" class="px-6 py-4 text-center text-gray-500">No messages found.</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>
    <div class="p-4">
        <?php echo e($messages->links()); ?>

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

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/sumankc/Desktop/ Websites/Dr Rajan/resources/views/admin/messages/index.blade.php ENDPATH**/ ?>